HERE Starter Edition Version 3.1 iOS SDK Developer's Guide
Reklama
Reklama
HERE iOS SDK
Developer's Guide
Starter Edition Version 3.1
HERE iOS SDK Developer's Guide
► Contents
2
Contents
Legal Notices
6
Document Information
7
Service Support
8
Creating a Simple Application Using the HERE SDK
.............................................................................
Geocoding and Reverse Geocoding
.............................................................................................
HERE iOS SDK Developer's Guide
► Contents
3
Chapter 4: Supplemental Information
.................................................................................
Creating a Simple HERE SDK Application Using Swift
..........................................................................
Chapter 5: Coverage Information
............................................................................................
..............................................................................................
HERE iOS SDK Developer's Guide
► Contents
4
.................................................................................................
.............................................................................................
HERE iOS SDK Developer's Guide
► Contents
5
HERE iOS SDK Developer's Guide
► Legal Notices
6
Legal Notices
© 2015 HERE Global B.V. and its Affiliate(s). All rights reserved.
This material, including documentation and any related computer programs, is protected by copyright controlled by HERE. All rights are reserved. Copying, including reproducing, storing, adapting or translating, any or all of this material requires the prior written consent of HERE. This material also contains confidential information, which may not be disclosed to others without the prior written consent of HERE.
Trademark Acknowledgements
HERE is trademark or registered trademark of HERE Global B.V.
Other product and company names mentioned herein may be trademarks or trade names of their respective owners.
Disclaimer
This content is provided "as-is" and without warranties of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, satisfactory quality and non-infringement. HERE does not warrant that the content is error free and HERE does not warrant or make any representations regarding the quality, correctness, accuracy, or reliability of the content. You should therefore verify any information contained in the content before acting on it.
To the furthest extent permitted by law, under no circumstances, including without limitation the negligence of HERE, shall HERE be liable for any damages, including, without limitation, direct, special, indirect, punitive, consequential, exemplary and/ or incidental damages that result from the use or application of this content, even if HERE or an authorized representative has been advised of the possibility of such damages.
HERE iOS SDK Developer's Guide
► Document Information
Document Information
Product
Name:
Version:
Document
Name:
Id:
Status:
Date:
HERE iOS SDK
Starter Edition Version 3.1
HERE iOS SDK Developer's Guide aa68db8-1450143620
FINAL
2015-Dec-15, 1:41 (GMT)
7
HERE iOS SDK Developer's Guide
► Service Support
8
Service Support
If you need assistance with this or other HERE products, please contact your HERE representative or
Technical Customer Support.
HERE iOS SDK Developer's Guide
► Overview
Chapter
1
Overview
Topics:
•
•
•
9
The HERE iOS SDK offers APIs to enable developers to access HERE location-based assets and bring a rich and immersive location experience to their applications with beautiful and accurate maps, a global database of Places and a world-class routing capability.
To address requests from customers for a smaller footprint SDK, the Starter Edition was introduced with SDK 3.0. The Starter
Edition can be viewed as offering native APIs for Search (Places,
Geocoding and Reverse Geocoding), Routing, and also rendering of raster map tiles. Map tile rendering uses OpenGL to ensure good performance and caching of map tiles is implemented to minimize re-download of previously downloaded tiles. Additionally, support is added for basic gestures and adding objects to the map.
The articles that follow introduce the HERE iOS SDK, explain essential concepts and describe the common use cases it supports.
HERE iOS SDK Developer's Guide
► Overview
10
What is the HERE iOS SDK?
The HERE iOS SDK provides a set of programming interfaces that enable developers to build immersive, geographically-aware iOS applications by leveraging a powerful and flexible mapping platform. Through this SDK, developers can add rich location features such as routing, interactive maps, and global place search to their applications. The powerful client-side HERE iOS SDK also includes a sophisticated engine for rendering map data and calculated routes.
Feature List
The main features offered by the HERE iOS SDK are listed below.
HERE Maps data
Embeddable maps
Gestures
Objects
Routing
Places and Search
The API provides full access to world-leading map data in three different modes: normal, satellite, and terrain. These are the same maps used by Bing and Yahoo, as well as four out of five on-board car navigation systems. The map data is constantly updated to reflect our changing world, with over two million changes per day.
The API allows you to add beautiful maps into native iOS applications.
The HERE SDK supports by default a large range of gestures, allowing users to interact with the map in a natural and delightful way. These gestures include panning, double-tap, and pinch-zoom.
To help represent information on the map, you can use map objects such as markers, polylines, polygons, and circles
The HERE SDK supports route calculation with multiple waypoints, optimized for Driving or Walking. Options such as 'Avoid Toll Roads' or 'Avoid Parks' can be specified, or alternatively, the fastest route can be requested.
Search millions of businesses and Points of Interest registered as HERE
Places. Supported use cases include searching for places by name, finding what is at the user's current location, exploring nearby places based on reviews and popularity, and identifying what users see around them.
HERE iOS SDK Developer's Guide
► Overview
11
Legal Requirements
In addition to the applicable
terms and conditions
under which you have licensed the SDK, the following shall apply.
Components of the HERE SDK collect certain information from your application. Such information includes access credentials (
App_Id
,
App_Code
and licenseKey
– see also
on page 19) and the types of features utilized by your application when used by end users. The information does not identify an individual end user. However, your application’s privacy policy must disclose to the end users that you have licensed products and services from HERE and that such information is collected from your application as it is being used by end users and that
HERE collects and processes such information from the application.
HERE iOS SDK Developer's Guide
► Quick Start
Chapter
2
Quick Start
Topics:
•
Creating a Simple Application Using the HERE SDK
The articles in this section provide information to help you start using the HERE iOS SDK.
12
HERE iOS SDK Developer's Guide
► Quick Start
13
Creating a Simple Application Using the HERE SDK
This guide provides instructions on creating a simple HERE iOS SDK application to render a map on an iOS device. Users are able to navigate the map by way of touch gestures such as panning, rotating, tilting, and pinching. The contents of this guide apply to Xcode 7.0 and the iOS 9 SDK.
Note: This tutorial applies to development using Objective-C. For information on how to perform the same tasks using Swift, see
Creating a Simple HERE SDK Application Using Swift
on page 57.
Create a New Single View Application
1. From XCode menu, select File > New > Project to open the New project dialog (or press Shift +
Command + N).
2. Select iOS > Application > Single View Application as the application type you want to create.
Press Next.
3. In the next dialog, enter your Product Name (such as
HelloMap
) and
Organization Identifier
(such as edu.self
). The resulting Bundle Identifier must be the same as you have registered on
developer.here.com
.
4. Next, choose "Objective-C" under Language, then choose "iPhone" under Devices, then click
Next. Navigate to the directory where you want your project to be stored and then select Create.
5. The next step is to configure this project to use the HERE SDK.
Configure the Application
1. Extract the HERE iOS SDK archive to somewhere in your local file system.
2. Add the
NMAKit
framework and bundle to your Xcode project. To add the
NMAKit
framework to your Xcode project, open the add files dialog. Select
File > Add Files To [Project Name], then select the "NMAKit.framework" folder. Ensure that the "Create folder references" and "Copy items if needed" options are selected, then select
Add.
HERE iOS SDK Developer's Guide
► Quick Start
Note: Dragging the NMAKit framework directory from the Finder into your project also has the same effect.
Figure 1: Add File to Target
14
3. Do the same for the
NMABundle.bundle
file. This file is found in the
HelloMap/
NMAKit.framework/Resource
directory. However, do
not
select the "Copy items if needed" option.
4. Next, add the NMAKit dependencies to your Xcode project. The NMAKit has a number of dependencies on other frameworks and libraries. Ensure that the items in the following list are present in the
Targets > Build Phases > Link Binary With Libraries section. If they are not present, add them using the + sign button. You can find this section by clicking on your project, in the Project Navigator and then selecting the
Build Phases tab in the Standard Editor.
• libc++.dylib (libc++.tbd on iOS 9)
• libsqlite3.dylib (libsqlite3.tbd on iOS 9)
• GLKit.framework
• SystemConfiguration.framework
5. Run the application. From the Xcode menu bar, select Product > Run. Ensure that the project runs in the iOS Simulator without errors.
6. The HERE iOS SDK is now ready for use in your Xcode project. Now that you have your project configured to work with the HERE SDK, try extending the sample application to render a map.
Create the Map View
In this section, we utilize the
NMAMapView
and
NMAGeoCoordinates
classes to render a Map.
1. Create an
NMAMapView
.
a. Select
Main.storyboard
in the navigator, then open the Utilities view by pressing the key combination Command + Option + Control + 3. Drag and drop a View object from the
Object Library onto the View Controller. If necessary, resize the View so it takes up the entire viewable area.
HERE iOS SDK Developer's Guide
► Quick Start
15
b. In the Interface Builder, click on the created View and then open the Identity Inspector in the Utilities view by pressing the key combination Command + Option + 3. Change the class value from
UIView
to
NMAMapView
and press return. In the Document Outline, you should see that the name of the View has changed from to
View
to
Map View
.
Figure 2: MapView
2. Create an outlet to
NMAMapView
in
ViewController
.
a. Select
Main.storyboard
in the navigator.
b. Press Command + Option + Return to open the Assistant Editor. It should show
ViewController.m
.
c. Add the following import statement to the top of this file:
#import <NMAKit/NMAKit.h>
d. Hold the Control key on the keyboard and click to drag from the Map View to the interface block in
ViewController.m
. You should see a blue line and tooltip which says "Insert Outlet or
Outlet Connection". Release the mouse button and a dialog appears, allowing you to create an outlet.
e. Name the outlet
mapView
, keep the other default options and then select Connect.
HERE iOS SDK Developer's Guide
► Quick Start
3. Now an outlet to
NMAMapView
is set. The modified file should be as follows:
#import "HelloMapViewController.h"
#import <NMAKit/NMAKit.h>
@interface HelloMapViewController ()
@property (weak, nonatomic) IBOutlet NMAMapView *mapView;
@end
@implementation HelloMapViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end
4. Implement
NMAMapView
setup and lifecycle code by modifying the viewDidLoad
method as shown:
- (void)viewDidLoad
{
[super viewDidLoad];
[NMAMapView class];
//set geo center
NMAGeoCoordinates *geoCoordCenter =
[[NMAGeoCoordinates alloc] initWithLatitude:49.260327 longitude:-123.115025];
[self.mapView setGeoCenter:geoCoordCenter withAnimation:NMAMapAnimationNone];
self.mapView.copyrightLogoPosition = NMALayoutPositionBottomCenter;
//set zoom level
self.mapView.zoomLevel = 13.2;
}
Note: The
[NMAMapView class]
method must be called before other
NMAMapView features can be used.
5. Add your HERE application credentials.
a. Open
AppDelegate.m
and import the
NMAKit.h
header by adding
#import <NMAKit/
NMAKit.h>
b. Add the following in the didFinishLaunchingWithOptions
method, replacing
YOUR_APP_ID
and
YOUR_APP_CODE
with the credentials that you received from
http:// developer.here.com
.
[NMAApplicationContext setAppId:@"{YOUR_APP_ID}"
appCode:@"{YOUR_APP_CODE}"];
16
HERE iOS SDK Developer's Guide
► Quick Start
17
6. Build and run the application. If the build is successful, you now have an application that displays a map similar to the following screenshot and allows you to manipulate it using gestures.
Figure 3: Running the App
HERE iOS SDK Developer's Guide
► User Guide
Chapter
3
User Guide
Topics:
•
•
•
•
•
•
The articles in this section provide a guide to using the HERE iOS
SDK.
18
HERE iOS SDK Developer's Guide
► User Guide
19
System Requirements
• iOS 8.0 or above. iOS 9 is recommended for optimal operation.
• XCode 7.0 or above, running on Mac OS X 10.10 or above.
Note: The HERE iOS SDK does not currently support Bitcode. Developers building apps with the HERE SDK should set
ENABLE_BITCODE
to
NO
in the Xcode settings.
• iPhone 4S or newer devices
• For storage of application binaries, an additional ~1MB for the HERE SDK libraries if bundled with the application should be taken into account.
• Device storage is required for persistent storage of map data. At a minimum, 32MB of free space is required to be available for map data
Authenticating Applications
Developers using the HERE SDK with their app are required to register for a set of HERE credentials, and to specify these credentials (
App_Id
and
App_Code
) in their application. Failure to do so results in blocked access to certain features and degradation in the quality of other services.
To obtain these credentials, please visit the developer portal at
http://developer.here.com
.
Note: Credentials are unique to your application's bundle identifier. Do not reuse credentials across multiple applications.
Adding Credentials to the Manifest
Ensure that you have provided the app_id
and app_code
before using the HERE SDK. For example, set them in your app delegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[NMAApplicationContext setAppId:@"{YOUR_APP_ID}" appCode:@"{YOUR_APP_CODE}"];
return YES;
}
Mapping
HERE iOS SDK Developer's Guide
► User Guide
20
Maps
The core feature of the HERE iOS SDK is Mapping. The key concepts covered in this section include adding a map to an iOS application, changing the location displayed by the map, and modifying its properties. The primary component of the mapping API is the
NMAMapView
, which is integrated with the Cocoa Touch framework as a
UIView
subclass.
NMAMapView
represents the view to display map and various properties. The
NMAMapView
is derived from
UIView
and part of iOS Cocoa Touch framework.
Note: To create a simple map application, refer to the
section.
The first step to integrate a map into an application is to insert a
NMAMapView
to your view controller's
.xib
file or the storyboard of the application using the Interface Builder. Alternatively, you can also add
NMAMapView
to your view controller programmatically as follows:
- (void)viewDidLoad
{
mapView = [NMAMapView alloc] initWithFrame:self.view.frame];
[self.view addSubview:mapView];
}
The
NMAMapView
class handles all user interactions in the form of touch gestures. More details
about the supported gesture types can be found in the
Working with NMAMapView
Once the
NMAMapView
is initialized, it can be manipulated and interacted in a variety of ways.
Some key attributes of the
NMAMapView
are its geographical center ( geoCenter
) and zoom level
( zoomLevel
). These properties may be used to customize the
NMAMapView
display. For example, the following code demonstrates how to show a view of Vancouver, Canada.
NMAGeoCoordinates *geoCoordCenter = [[NMAGeoCoordinates alloc]
initWithLatitude:49.260327 longitude:-123.115025];
[self.mapView setGeoCenter:geoCoordCenter withAnimation:NMAMapAnimationNone];
In the preceding code:
• The geographical location
[NMAGeoCoordinates]
for the new map center is created by a call to the -
(id)initWithLatitude:(double)aLatitude longitude:(double)aLongitude method.
• When setting the center of a map, the transition can be animated by passing the
NMAMapAnimationLinear
enum value to the animation
parameter. Animation can also be suppressed by using the
NMAMapAnimationNone
value.
HERE iOS SDK Developer's Guide
► User Guide
21
The beginning and ending of these events may be observed by assigning an object to the
NMAMapView
's delegate property. The object should implement the methods of the
NMAMapViewDelegate
protocol corresponding to the events you wish it to receive. This delegate can also be used to detect
.
Note: For optimum performance, avoid resizing a map after it has been created. If resizing is necessary, create the map at the largest size to be used and reduce it later.
Resolution and Text Size
By default, the HERE SDK uses high-resolution (512 x 512 pixels) map tiles. You can set the useHighResolutionMap
property in
NMAMapView
to
NO
to use lower-resolution (256 x 256 pixels) map tiles instead.
You can also use the mapPPI
property to change the map's pixel-per-inch setting. The default setting is
NMAMapPPILow
. Setting the property to
NMAMapPPIHigh
makes street labels and other text to be bigger.
Properties of NMAMapView
The following examples show how to work with some of the properties in
NMAMapView
:
Map Center
The center of the map determines the geographical area to be displayed. It can be read using the
NMAMapView geoCenter
property, and set using one of the setGeoCenter:
methods. Its type is
NMAGeoCoordinates
.
// Move the map to London.
NMAGeoCoordinates *geoCoordCenter = [[NMAGeoCoordinates alloc] initWithLatitude:51.51 longitude:-0.11];
[self.mapView setGeoCenter:geoCoordCenter withAnimation:NMAMapAnimationNone];
Zoom Level
The size of the geographical area displayed by the map can be controlled by changing the zoom level. The zoom level ranges from
NMAMapView::minimumZoomLevel
to
NMAMapViewMaximumZoomLevel
, with a higher zoom value being closer to the ground. The following code sets the zoom level to the median zoom level:
// Set the zoom level to the median.
mapView.zoomLevel =
(mapView.minimumZoomLevel + NMAMapViewMinimumZoomLevel)/2.0f;
Note: The
NMAMapView::minimumZoomLevel
property provides the effective minimum zoom level depending on the current map and device display parameters, such as display resolution. To retrieve the minimum zoom level that does not take these parameters into account, use
NMAMapViewMinimumZoomLevel
.
HERE iOS SDK Developer's Guide
► User Guide
22
Animations
The
NMAMapView
supports the following animation settings to be used while changing properties, defined by the
NMAMapAnimation
enum:
•
NMAMapAnimationNone
•
NMAMapAnimationLinear
// Move to London using bow animation
NMAGeoCoordinates *geoCoordCenter = [[NMAGeoCoordinates alloc]
initWithLatitude:51.51 longitude:-0.11];
[mapView setGeoCenter:geoCoordCenter withAnimation:NMAMapAnimationLinear];
Setting Multiple Attributes
An extended API is provided to change one or more attributes at the same time.
-(void) setGeoCenter:(NMAGeoCoordinates*) coordinates
zoomLevel:(float) level
withAnimation:(NMAMapAnimation) animation
To leave a map attribute unchanged, pass the
NMAMapViewPreserveValue
constant to the relevant method parameter.
// Move to Vancouver, preserving zoom level
NMAGeoCoordinates* coord = [[NMAGeoCoordinates alloc]
initWithLatitude:49.0
longitude:123.0];
[mapView setGeoCenter:coord
zoomLevel:NMAMapViewPreserveValue
withAnimation:NMAMapAnimationBow];
For more information about the APIs introduced and demonstrated in this section, refer to the API
Reference documentation.
Map Gestures
The
NMAMapView
class responds to a number of predefined touch gestures. The default behavior of the map for each gesture type may be used as-is, supplemented, or replaced entirely. The following table is a summary of the available gestures and their default behavior.
To select a visible map object, tap the screen with one finger.
HERE iOS SDK Developer's Guide
► User Guide
23
To zoom the map in a fixed amount, tap the screen twice with one finger. Tap continuously to make a continuous zoom.
To zoom out a fixed amount, tap the screen with two fingers. Tap continuously to make a continuous zoom.
To move the map, press and hold one finger to the screen, and move it in any direction.
Press and hold two fingers to the screen and move them in the same direction. This gesture does not have a predefined map action.
To pan the map with momentum, press and swipe one finger on the screen. The map continues to move in the same direction, and gradually slow to a stop.
To continuously zoom in or out, press and hold two fingers to the screen, and increase or decrease the distance between them.
Pressing and holding one finger to the screen activates the long press gesture. This gesture does not have a predefined map action.
The time required to trigger a long press gesture can be customized using the
NMAMapView longPressDuration
property. The default value for this property is one second.
HERE iOS SDK Developer's Guide
► User Guide
24
Controlling the NMAMapView Gesture Response
Any of the gestures listed above may be selectively enabled or disabled on an
NMAMapView instance using the enableMapGestures:
and disableMapGestures:
methods. These methods take a single input parameter that is an "or" combination of
NMAMapGestureType
values, which are defined in
NMAMapGesture.h
. The state of a specific gesture may be checked with isMapGestureEnabled:
.
The following code shows how to disable all panning gestures:
// mapView is a valid NMAMapView instance
[mapView disableMapGestures:(NMAMapGestureTypePan | NMAMapGestureTypeTwoFingerPan)];
Gesture Delegation
To receive notifications of gestures, you can implement the
NMAMapGestureDelegate
and use the corresponding handler methods. For example:
@implementation MyGestureDelegate
// ...
-(void)mapView:(NMAMapView*)mapView didReceiveTapAtLocation:(CGPoint)location
{
// a gesture was received
// location is available through the "location" parameter
}
@end
Note: Implementing the handler method does not have any impact on how the map responds to the gesture. For example, the logic within mapView:didReceiveDoubleTapAtLocation:
is called when the map has zoomed in.
Map Schemes
Specific map schemes are available to offer your application users a choice among different kinds of map appearance.
Setting the Scheme
The
NMAMapScheme.h
file defines schemes that the HERE map service supports. You can set a desired scheme by changing the mapScheme
property of
NMAMapView
. For example: mapView.mapScheme = NMAMapSchemeNormalDay;
HERE iOS SDK Developer's Guide
► User Guide
25
Examples of Map Schemes
All available schemes are defined as constant strings in the
NMAMapScheme.h
file. The string values that your application can use to set a map scheme include:
Figure 4: NMAMapSchemeNormalDay Figure 5: NMAMapSchemeSatelliteDay
Figure 6: NMAMapSchemeHybridDay Figure 7: NMAMapSchemeNormalNight
HERE iOS SDK Developer's Guide
► User Guide
Figure 8: NMAMapSchemeTerrainDay
Figure 9: NMAMapSchemeReducedDay Figure 10: NMAMapSchemeReducedNight
26
HERE iOS SDK Developer's Guide
► User Guide
27
Objects and Interaction
The HERE SDK allows the addition of a variety of objects, each with a specific purpose, to a map view.
The types of available object include map markers, routes, polylines, and overlays. These objects are described in more detail below.
The NMAMapObject Class
The
NMAMapObject
class provides a generic base class from which most types of specialized map object inherit. Functionality that is common to all these object types is encapsulated in
NMAMapObject
. The following is a list of the important properties and methods in
NMAMapObject
.
• zIndex
- determines the objects stacking order, which controls how the object is displayed on the map relative to other objects that may overlap it
• visible
- determines whether or not the object is drawn when the map is rendered
• type
- contains the type of the map object, such as marker, polyline, and route. For the full list, see the
NMAMapObject
API reference.
• parent
- the
NMAMapContainer
instance holding this object, if any
• uniqueId
- uniquely identifies the object for the duration of the application launch
Note:
•
NMAMapObject
serves as a base class to other map object types and should not be instantiated directly.
• Any change in a map object's visual appearance causes the entire map view to be redrawn, since map objects are drawn as part of the map itself. For optimal performance, map objects should not be frequently updated unless it is necessary.
The NMAMapContainer class
Map containers are a special type of map object that can be used to group together other map objects of certain types. The types of object allowed are
NMAMapMarker
,
NMAMapCircle
,
NMAMapPolygon
, and
NMAMapPolyline
. Containers provide a convenient way to control the stacking order and visibility of a large group of objects.
To use a map container, create one or more map objects and add them to the container using the addMapObject
method. To show the objects on a map, add the map container to the map with the addMapObject
method of
NMAMapView
.
Note: A container may also hold other instances of
NMAMapContainer
.
HERE iOS SDK Developer's Guide
► User Guide
28
The NMAMapCircle class
An
NMAMapCircle
class is used to draw a circle on the map at a fixed geographical location; custom border and fill colors may be defined.
Figure 11: A
MapCircle
object
HERE iOS SDK Developer's Guide
► User Guide
29
The NMAMapPolyline class
The
NMAMapPolyline
class is used to draw one or more connected line segments on the map. The segment vertices are specified by a series of
NMAGeoCoordinates
. The visual appearance of the polyline can be customized.
Figure 12: A
MapPolyline
object
HERE iOS SDK Developer's Guide
► User Guide
30
The NMAMapPolygon interface
The
NMAMapPolygon
class is similar to
NMAMapPolyline
, but the first and last points of the line are automatically joined to create a closed shape. Polygon objects can have different border and fill colors.
Figure 13: A
MapPolygon
object with transparent fill and a border
Note: Polygons that have a path that crosses over itelf are not supported. For example, it is not possible to create a "bowtie" shape using four line segments, where one line segment crosses over another. However, you can create the shape using two triangles.
The NMAMapMarker class
The
NMAMapMarker
class is used to display a custom icon at a fixed geographical position on the map.
HERE iOS SDK Developer's Guide
► User Guide
Custom icons can be provided as an
UIImage
.
Figure 14: A
MapMarker
object
31
Map Object Selection
All user-defined objects with a visual representation can be selected. Selection occurs when a visible object on the map is tapped. By default, the map does not take any action when objects are selected.
To implement selection handling, a custom class must implement the
NMAMapViewDelegate protocol and its onMapObjectsSelected
method. The onMapObjectsSelected
callback returns an array that contains instances of
NMAViewObject
, which is a superclass of
NMAMapObject
.
Object selection can also be programmatically invoked by using the objectsAtPoint:
or visibleObjectsAtPoint:
method. Each of these methods takes a
CGPoint
screen coordinate and returns an
NSArray
of
NMAMapObject
at that location. The visibleObjectsAtPoint
method does not return any object that has the visible
property set as
NO
.
For more information, see the
NMAMapView
API documentation.
Custom Raster Tiles
You can use the HERE iOS SDK to enhance maps with the custom raster tiles API —
NMAMapTileLayer
.
Custom raster tiles are tile images that you can add to a map for enhancing the map with extra information over a large geographical area. If the application is set to display custom raster tiles, then users see them whenever they view a designated geographical area at a specified zoom level or range of zoom levels.
HERE iOS SDK Developer's Guide
► User Guide
32
You can provide tile images in two ways:
1. Store custom raster tile images on a remote server and return URLs via the
NMAMapTileLayerDataSource mapTileLayer:urlForTileAtX:y:zoomLevel:
protocol method.
2. Provide raw bitmap data using the
NMAMapTileLayerDataSource mapTileLayer:requestDataForTileAtX:y:zoomLevel:
protocol method.
Dividing a Map and Using Tile Coordinates
NMAMapTileLayer
uses a scheme that divides the world map into tiles, specified by x, y and zoom level coordinates. This coordinate system is used by the
NMAMapTileLayerDataSource
protocol when it requests tiles.
At each zoom level, it is expected that the world map is rendered on (2
zoomlevel
)
2
tiles:
• at level 3: 8 x 8 = 64 tiles
• at level 4: 16 x 16 = 256 tiles
• continuing on until zoom level 20
HERE iOS SDK Developer's Guide
► User Guide
For example, at zoom level 2, the world map would be divided up as follows:
Figure 15: World Map at Zoom Level 2
33
The x and y parameters indicate which tile is being requested for the given zoom level.
You need to provide enough tile images to cover all the zoom levels you are supporting within a geographical area. You can restrict custom tile rendering to a specific
NMAGeoBoundingBox using the boundingBox
property of
NMAMapTileLayer
. You can restrict the zoom level using showAtZoomLevel:
and related methods.
Supplying Tiles from a Web Server
The steps for providing custom tiles from a web server to a map view are as follows:
1. Host the appropriate number of tiles on a server according to the zoom levels and
NMAGeoBoundingBox
you are supporting. The tiles must be in either PNG or JPG format and should be sized at 256 x 256 or 512 x 512 pixels.
Note: As long as your tiles conform to 256 by 256 or 512 by 512 pixels, the
NMAMapView
can scale the image to fit the current map resolution. For example, if the useHighResolutionMap
property is set to
YES
(512 by 512 pixels) but your tiles are
256 by 256 pixels, the
NMAMapView
enlarges your image tiles.
HERE iOS SDK Developer's Guide
► User Guide
2. Create an object that derives from
NMAMapTileLayerDataSource
and implement the mapTileLayer:urlForTileAtX:y:zoomLevel:method
to return a URL pointing to the specified tile on your server.
3. Create an
NMAMapTileLayer
object and set its properties to correspond with the tile data source server. At a minimum, set the boundingBox
and zoomLevel
properties to reflect the tiles hosted on your server. Set the dataSource
property.
4. Add the
NMAMapTileLayer
object to the
NMAMapView
by calling the addMapTileLayer: method.
The following code snippet shows a class that renders the Queen Elizabeth Olympic Park in
London. The park is displayed as a tile layer that is added to an
NMAMapView
, and the raster tiles are served from the HERE server. To use this class, call
[OlympicParkTileLayer addOlympicParkTileLayerToMapView:myMapView]
.
@interface OlympicParkTileLayer : NMAMapTileLayer <NMAMapTileLayerDataSource>
@end
@implementation OlympicParkTileLayer
+(void)addOlympicParkTileLayerToMapView:(NMAMapView*)mapView
{
OlympicParkTileLayer *tileLayer = [OlympicParkTileLayer new];
[mapView addMapTileLayer:tileLayer];
[mapView setGeoCenter:tileLayer.boundingBox.center
zoomLevel:14.0
withAnimation:NMAMapAnimationNone ];
}
-(id)init
{
if (self = [super init]) {
// Set the data source
self.dataSource = self;
// Limit the tiles to the bounding box supported by the server
NMAGeoBoundingBox *olympicParkBoundingBox =
[NMAGeoBoundingBox geoBoundingBoxWithTopLeft:[NMAGeoCoordinates
geoCoordinatesWithLatitude:51.557000 longitude:-0.042772]
bottomRight:[NMAGeoCoordinates geoCoordinatesWithLatitude:51.525941
longitude: 0.028296]];
self.boundingBox = olympicParkBoundingBox;
// Enable caching
self.cacheTimeToLive = 60 * 60 * 24; // 24 hours
self.cacheSizeLimit = 1024 * 1024 * 64; // 64MB
[self setCacheEnabled:YES withIdentifier:@"OlympicParkTileLayer"];
}
return self;
}
-(NSString *)mapTileLayer:(NMAMapTileLayer *)mapTileLayer
urlForTileAtX:(NSUInteger)x
y:(NSUInteger)y
zoomLevel:(NSUInteger)zoomLevel
{
// Return a URL for the specified tile
// This tile source is hosted by HERE Global B.V. and may be removed at any time
return [NSString stringWithFormat:
34
HERE iOS SDK Developer's Guide
► User Guide
35
@"http://api.maps.example.org/maptiles/olympic_park/normal.day/%d/%d/%d.png",
zoomLevel,
y,
x ];
}
@end
Supplying Tiles as Bitmaps
You can choose to supply tiles as bitmaps if your app uses bundled static tiles, dynamicallygenerated tiles, or if the server that you are using for tile images requires authentication. In the third case, since
NMAMapTileLayer
only uses simple HTTP GET requests to retrieve tile images, it is up to you to provide code that handles authentication and downloads the tiles. Once the tiles have been downloaded, you can use them as local bitmaps with the
NMAMapTileLayer
class.
The steps for providing custom tiles as local bitmaps to a map view are as follows:
1. Create an object that derives from
NMAMapTileLayerDataSource
and implements the mapTileLayer:requestDataForTileAtX:y:zoomLevel:
method.
2. Create an
NMAMapTileLayer
object and set its properties to correspond with the tile data source. Set the dataSource
property.
3. Add the
NMAMapTileLayer
object to the
NMAMapView
by calling the addMapTileLayer: method.
Caching Tiles
Tiles can be cached to the disk to improve performance and reduce data traffic in the URL fetching case.
When you enable caching, you must provide a cache identifier. This identifier must be unique for each
NMAMapTileLayer
used within your application. Since the cache persists across app sessions, it is important to use the same identifier across sessions (by defining a constant, for example).
You can optionally limit the cache size and time-to-live for each cached tile. The cache can be cleared at any time by calling
[NMAMapTileLayer clearCache]
. To be sure the cache is completely cleared first remove the
NMAMapTileLayer
from the map view before calling
[NMAMapTileLayer clearCache]
.
The following code enables disk caching with a 128MB maximum size and a tile time-to-live of 7 days:
NMAMapTileLayer *tileLayer = [[NMAMapTileLayer alloc]init]; tileLayer.dataSource = self; // Assuming self is a valid data source
[tileLayer setCacheEnabled:YES withIdentifier:@"MyUniqueTileCacheIdenfifier"]; tileLayer.cacheTimeToLive = 60 * 60 * 24 * 7; // 7 days tileLayer.cacheSizeLimit = 1024 * 1024 * 128; // 128 MB
[mapView addMapTileLayer:tileLayer]; // NOTE: add to map view after setting tile properties
HERE iOS SDK Developer's Guide
► User Guide
36
Performance Tips
1. IMPORTANT: Set
NMAMapTileLayer
properties before adding the tile layer to the map view.
Most properties ignore attempts to set them after being added to the view.
2. Ensure the properties you set on the tile layer match the data you are supplying via the
NMAMapTileLayerDataSource
protocol.
3. Do not block
NMAMapTileLayerDataSource
methods for extended periods of time. For example, if it takes a while to generate tiles on the fly move the processing to a separate GCD queue.
4. If requesting a specific tile is constantly failing consider implementing mapTileLayer:hasTileAtX:y:zoomLevel:
, returning
NO
.
5. Use the provided disk caching mechanism.
Common Operations
Positioning
An application created using the HERE iOS SDK can use information from the positioning capabilities of a user's device to display its position, and, optionally, provide real-time updates. Getting the current position requires an application to make use of the
NMAPositioningManager
interface from the HERE SDK. In order to receive position updates or position-lost notifications, an application should use
NSNotificationCenter addObserver
with the notification names found in
NMAPositioningManager.h
:
•
NMAPositioningManagerDidUpdatePositionNotification
•
NMAPositioningManagerDidLosePositionNotification
The user's current position can be easily displayed on the map using the
NMAPositionIndicator class. Each instance of
NMAMapView
owns an instance of this class, accessed via the positionIndicator
property.
NMAPositioningManager
The
NMAPositioningManager
class provides information related to the device's geographical location, such as the current position and the average speed.
NMAPositioningManager
is a singleton class and thus should only be accessed through the sharedPositioningManager
class method.
HERE iOS SDK Developer's Guide
► User Guide
37
Note: As of iOS 8, you are required to add
NSLocationWhenInUseUsageDescription to your project's
Info.plist
so that
CLLocationManager
can properly access the user's location. For example,
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs to access your current location to display it on the map.
</string>
The value of this key is displayed to the user when the system requests for permission to use location services. For more information about this key, please consult
this article
.
To start receiving real time positioning updates, the application needs to call
NMAPositioningManager startPositioning
, which uses the internal GPS as the update mechanism. This method returns a
BOOL
value, indicating whether or not positioning was successfully started.
While position updates are being received, the application can retrieve the current position of the client device through the
NMAPositioningManager currentPosition
property. This current position is equal to the rawPosition
property. rawPosition
is a position value from the current data source that has not been modified by the HERE SDK engine. If the positioning manager is not active, or it has an invalid position, then the currentPosition
method returns nil
.
Note: Map matching is disabled by default. It can be enabled automatically through the use of any HERE SDK feature which requires map matching, such as navigation, or it can be manually enabled by setting mapMatchingEnabled
to
YES
. When map matching is disabled, mapMatchedPosition
returns nil
, and currentPosition
returns the raw position.
When the application no longer requires position updates, it should notify the
NMAPositioningManager
by calling stopPositioning
. Position updates are then stopped, provided that no other SDK services (such as
NMAPositionIndicator
) that require position updates are in use.
NMAPositioningManager Notifications
The
NMAPositioningManager
notifications can be used to track position updates of a client device as determined by its positioning mechanism (for example, its GPS). To register or unregister for these notifications, use the following methods:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(methodName)
name:NMAPositioningManagerDidUpdatePositionNotification
object:[NMAPositioningManager sharedNMAPositioningManager]];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NMAPositioningManagerDidUpdatePositionNotification
object:[NMAPositioningManager sharedNMAPositioningManager]];
HERE iOS SDK Developer's Guide
► User Guide
38
Applications can register for two types of notifications:
•
NMAPositioningManagerDidUpdatePositionNotification
•
NMAPositioningManagerDidLosePositionNotification
Note:
NSNotificationCenter
does not limit how many times an object can register to the same notification. You should be careful not to register the same object more than once to a notification. Otherwise, the object receives duplicate notifications.
The following is an example of registering and handling these notifications in a
UIViewController
:
// Start positioning and register for position update notifications
- (void)viewDidLoad
{
...
if ([[NMAPositioningManager sharedNMAPositioningManager] startPositioning]) {
// Register to positioning manager notifications
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(positionDidUpdate)
name:NMAPositioningManagerDidUpdatePositionNotification
object:[NMAPositioningManager sharedNMAPositioningManager]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didLosePosition) name:
NMAPositioningManagerDidLosePositionNotification
object:[NMAPositioningManager sharedNMAPositioningManager]];
}
...
}
// Handle NMAPositioningManagerDidUpdatePositionNotification
- (void)positionDidUpdate
{
NMAGeoPosition *position = [[NMAPositioningManager sharedNMAPositioningManager]
currentPosition];
[_mapView setGeoCenter:position.coordinates
withAnimation:NMAMapAnimationLinear];
}
// Handle NMAPositioningManagerDidLosePositionNotification
- (void)didLosePosition
{
...
}
In order to avoid unnecessary position updates while the application is in the background, you can stop positioning and restart it when the application returns to the foreground using
UIApplicationDelegate
protocol callbacks.
The following code snippet demonstrates how to stop positioning and unregister from the notifications:
- (void)viewWillDisappear:(BOOL)animated
{
[[NMAPositioningManager sharedNMAPositioningManager] stopPositioning];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NMAPositioningManagerDidUpdatePositionNotification
object:[NMAPositioningManager sharedNMAPositioningManager]];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NMAPositioningManagerDidLosePositionNotification
object:[NMAPositioningManager sharedNMAPositioningManager]];
HERE iOS SDK Developer's Guide
► User Guide
}
Note: If you enable background location updates in the Xcode project, then
NMAPositioningManager
provides position updates even when your application is no longer in the foreground. To avoid this behavior, you can either stop the positioning manager before the app goes into the background, or you can disable this setting in Xcode.
NMAPositionIndicator
The
NMAPositionIndicator
class provides a convenient way to add a map object that marks the user's current location as reported by the
NMAPositioningManager
. The position indicator is rendered as a circular object within a translucent circle, the diameter of which illustrates the accuracy of the indicated position. The types of map objects can be used to customize
NMAPositionIndicator
are
NMAMapMarker
and
NMAMapCircle
.
Figure 16: An NMAPositionIndicator
39
Each
NMAMapView
instance has an
NMAPositionIndicator
instance which can be accessed from the
NMAMapView positionIndicator
property.
You can customize the accuracy circle's color and whether it is visible by using the accuracyIndicatorColor
and accuracyIndicatorVisible
properties.
// Display position indicator mapView.positionIndicator.visible = YES;
Note: Setting
NMAPositionIndicator
to visible automatically enables
NMAPositioningManager
updates.
HERE iOS SDK Developer's Guide
► User Guide
40
For the position indicator to stay in the center of the map and illustrate real-time updates of the device position, it is necessary to update the map's center whenever a new location update is received. Please note that frequently redrawing the map in this manner consumes device battery life.
You should be aware of battery power implications while performing real-time updates. The following code can be used to update the map location when a position update is received:
- (void)positionDidUpdate
{
NMAGeoPosition *position = [[NMAPositioningManager sharedNMAPositioningManager]
currentPosition];
[_mapView setGeoCenter:position.coordinates
withAnimation:NMAMapAnimationLinear];
}
For more information about the classes introduced and demonstrated in this section, refer to the
API reference documentation
.
Routing
Route Calculation For Walking or Driving
The HERE iOS SDK supports route calculation with multiple waypoints, optimized for walking or driving.
A route describes a path between at least two waypoints, the starting point and the destination, with optional intermediate waypoints in between. Applications can provide route information to users in two ways:
• a line rendered on a map that displays a connecting path between all waypoints
• turn-by-turn directions in text format
NMARouteManager
The
NMARouteManager
class is responsible for calculating an
NMARoute
using a list of stops and an
NMARoutingMode
. It also provides an
NMARouteManagerDelegate
protocol for monitoring calculation progress and triggering appropriate callback methods upon completion. To calculate a route, the application needs to call the calculateRouteWithStops:routingMode:
method.
NMARouteManager
only supports one routing request at a time. Making another request before completion of the current request is not supported.
Note:
NMARouteManager
supports routes with a maximum of 32 waypoints.
HERE iOS SDK Developer's Guide
► User Guide
NMARoutingMode
The
NMARoutingMode
class is a model of the parameters required to calculate an
NMARoute
, such as:
• routingType
- the routing type, such as Fastest or Shortest
• transportMode
- the mode of transportation
• routingOptions
- the routing options (represented by the
NMARoutingOption
enums) that are applicable for this route
• departureTime
- the departure time for the route
• resultLimit
- the maximum number of alternate routes to calculate (the actual number of results may be less than this limit)
Note: The HERE SDK allows for more than one route to be returned from a route calculation between two waypoints. You can use the
NMARoutingMode
class to set the desired number of routes, and the HERE SDK then returns different routes according to this limit. Note that the first element of the returned array is the best result based on the routing options, and the rest of the returned routes are not listed in any specific order.
NMARoute
The
NMARoute
class represents a distinct calculated path connecting two or more waypoints, and consists of a list of maneuvers and route links. A call to the calculateRouteWithStops:routingMode:
method of
NMARouteManager
triggers a route calculation, while the
NMARouteManagerDelegate
implements callback methods to monitor the operation and process the resulting
NMARoute
objects.
An
NMARoute
object contains route information that can be accessed by calling one or more of the following methods:
• routingMode
- the
NMARoutingMode
for the route
• waypoints
- the array of all waypoints for the route
• start
- the starting waypoint for the route
• destination
- the destination waypoint for the route
• maneuvers
- the array of maneuvers for the route
• length
- the length of the route, in meters
• tta
- the
NMARouteTta
indicating the estimated time to arrival
• boundingBox
- gets the smallest
NMAGeoBoundingBox
that contains the entire route
• routeGeometry
- gets the array of all
NMAGeoCoordinates
along the route
• mapPolyline
- gets the
NMAMapPolyline
representation of the route
41
HERE iOS SDK Developer's Guide
► User Guide
42
NMARouteTta
The
NMARouteTta
("time-to-arrival") class provides useful information about the route, such as duration and route details that impact travel duration, including car pool restrictions, turn restrictions, and blocked roads. For example, to retrieve a duration for a calculated route, use the tta
property. For example,
NSTimeInterval duration = route.tta.duration;
You can also retrieve the duration for a subleg from a route by using the ttaForSubleg:
method.
For example, if (myRoute.sublegCount > 0)
{
NSTimeInterval duration = [myRoute ttaForSubleg:0].duration;
}
NMAManeuver
The
NMAManeuver
class represents the action required to go from one segment to the next within a calculated
NMARoute
. Each
NMAManeuver
object provides information such as:
• location of the maneuver
• action required to complete the maneuver
• distance between maneuvers
• current road
• next road
• estimated times of the maneuver
• highway signpost (if any) indicating entrance, exit, or merge information
• a list of route elements representing portions of this maneuver
For more information, please consult the API Reference.
NMARouteElement and NMARoadElement
NMARouteElement
and
NMARoadElement
represent portions within a maneuver. For example, a maneuver may ask the driver to turn left and then remain on a street, but this street may be comprised of multiple sections, including a tunnel, a dirt road, and a toll road. In this situation, the maneuver contains multiple
NMARouteElement
objects, with each element containing a
NMARoadElement
property that can provide your application with information about the individual section of the road.
HERE iOS SDK Developer's Guide
► User Guide
43
NMAMapRoute
The
NMAMapRoute
class is a type of
NMAMapObject
that displays a calculated route on a map.
Typically, an application creates a
NMAMapRoute
after a route calculation, and add the
NMAMapRoute to the map by calling
NMAMapView addMapObject:
.
Figure 17: An
NMAMapRoute
added to an
NMAMapView
For example, if you want to render a route that connects two waypoints (start and destination), you can add the following application logic:
1. Adopt
NMARouteManagerDelegate
protocol and create a
NMARouteManager
@interface ClassName : NSObject <NMARouteManagerDelegate>
{
// Setup your class
}
(void)setup
{
// Create a NMARouteManager.
NMARouteManager* routeManager = [NMARouteManager sharedRouteManager];
// Setup delegate
[routeManager setDelegate:self];
}
2. Create an
NSMutableArray
and add two
NMAGeoCoordinates
stops
NSMutableArray* stops = [[NSMutableArray alloc] initWithCapacity:4];
NMAGeoCoordinates* geoCoord1 = [[NMAGeoCoordinates alloc] initWithLatitude:49.1966286 longitude:-123.0053635];
HERE iOS SDK Developer's Guide
► User Guide
44
NMAGeoCoordinates* geoCoord2 = [[NMAGeoCoordinates alloc] initWithLatitude:49.1947289 longitude:-123.1762924];
[stops addObject:geoCoord1];
[stops addObject:geoCoord2];
3. Create an
NMARoutingMode
and set its
NMATransportMode
,
NMARoutingType
and
NMARoutingOption
values
NMARoutingMode* routingMode = [[NMARoutingMode alloc]
initWithRoutingType:NMARoutingTypeFastest
transportMode:NMATransportModeCar
routingOptions:0];
4. Calculate the route
[routeManager calculateRouteWithStops:stops routingMode:routingMode];
5. To receive the results of the route calculation, implement the
NMARouteManagerDelegate protocol method routeManager:didCalculateRoutes:withError:violatedOptions:
in your delegate class.
Note: Routes are returned even if you receive the
NMARouteManagerErrorViolatesOptions
error. It is up to you to handle these route results that violate routing options.
-(void) routeManager: (NMARouteManager*)routeManager
didCalculateRoutes:(NSArray*)routes
withError:(NMARouteManagerError)error
violatedOptions:(NSArray*)violatedOptions
{
// If the route was calculated successfully
if (!error && routes && routes.count > 0)
{
NMARoute* route = [routes objectAtIndex:0];
// Render the route on the map
mapRoute = [NMAMapRoute mapRouteWithRoute:route];
[mapView addMapObject:mapRoute];
}
else if (error)
{
// Display a message indicating route calculation failure
}
}
Routing-related enumerations
Route calculations make use of HERE SDK enumerations that include:
• The
NMARoutingType
enum - represents values describing different routing types, such as
NMARoutingTypeFastest
or
NMARoutingTypeShortest
• The
NMATransportMode
enum - represents values describing different transport modes, such as
NMATransportModeCar
or
NMATransportModePedestrian
• The
NMARoutingOption
enum - represents values describing special conditions for route calculation, such as
NMARoutingOptionAvoidBoatFerry
or
HERE iOS SDK Developer's Guide
► User Guide
45
NMARoutingOptionAvoidTollRoad
. Values from this enum are also returned after a route calculation to indicate the options that a route result violates.
• The
NMARouteViolatedOption
enum - represents values describing special conditions that are violated in a route calculation in addition to
NMARoutingOption
. This enum contains values for blocked roads and turn restrictions. For example, after specifying a route calculation that avoids tolls and ferries, you may get a
NMARoute
with the
NMARouteViolatedOptionBlockedRoad
violated option. This indicates that although a route was found, this route goes through at least one blocked road—violating a condition of your route request.
• The
NMARouteManagerError
enum - represents values describing possible route calculation errors, such as
NMARouteManagerErrorNone
or
NMARouteManagerErrorViolatesOptions
Search
Geocoding and Reverse Geocoding
Geocoding and reverse geocoding APIs from the HERE iOS SDK allow application developers to offer search functionality for requesting
NMAPlaceLocation
information. Geocoding APIs resolve a freeformatted text query to an
NMAGeoCoordinates
, while reverse geocoding APIs resolve from an
NMAGeoCoordinates
to geographic data, such as
NMAAddress
.
NMAAddress
provides textual address information including house number, street name, city, country, district and more. It encompasses everything about an address or a point on the map.
The
NMAPlaceLocation
class represents an area on the map where additional attributes can be retrieved. These additional attributes include
NMAAddress
, unique identifier, label, location, access locations, and
NMAGeoBoundingBox
for the location.
The NMAGeocoder Interface
The
NMAGeocoder
interface represents a factory class used to instantiate location search requests.
Two types of requests are available:
NMAGeocodeRequest
and
NMAReverseGeocodeRequest
.
The NMAGeocodeRequest Interface
The
NMAGeocodeRequest
interface represents an extended
NMARequest
. The
NMAGeocodeRequest
can be created using a combination of a search area and a free text query string. This is known as a "one-box" request. It returns
NMAPlaceLocation
results
HERE iOS SDK Developer's Guide
► User Guide
46
according to the specified search area and text query. You can specify a search area by providing a
NMAGeoBoundingBox
or a location with a search radius.
The following shows the methods used to create one-box requests:
NMAGeocodeRequest* request = [[NMAGeocoder sharedGeocoder]
createGeocodeRequestWithQuery:string
searchArea:geoBoundingBox
locationContext:geoCoordinates];
NMAGeocodeRequest* request = [[NMAGeocoder sharedGeocoder]
createGeocodeRequestWithQuery:string
searchRadius:radius
locationContext:geoCoordinates];
The preceding methods return an
NMAGeocodeRequest
object. To perform the request, call its startWithListener:
method. The parameter of this method is an object which receives the request results; the object must implement the
NMAResultListener
protocol. Once a request is invoked, it can be canceled using the cancel
method of
NMARequest
, which returns a
BOOL
value indicating whether the result was canceled successfully. If the
NMAGeocodeRequest
is successful, a list of
NMAGeocodeResult
objects is returned to the listener.
The following code example demonstrates how to use a
NMAGeocodeRequest
:
// Implementation of NMAResultListener
@interface NMAGeocodeTest : NSObject<NMAResultListener> {
}
@implementation NMAGeocodeTest
// NMAResultListener protocol callback implementation
- (void)request:(NMARequest*)request
didCompleteWithData:(id)data
error:(NSError*)error
{
if ( ( [request isKindOfClass:[NMAGeocodeRequest class]]) ) &&
( error.code == NMARequestErrorNone ) )
{
// Process result NSArray of NMAGeocodeResult objects
[self processResult:(NSMutableArray *)data];
}
else
{
// Handle error
...
}
}
- (void) startSearch
{
NMAGeoCoordinates *topLeft =
[[NMAGeoCoordinates alloc]
initWithLatitude:52.537413 longitude:13.365641];
NMAGeoCoordinates *bottomRight =
[[NMAGeoCoordinates alloc]
initWithLatitude:52.522428 longitude:13.39345];
NMAGeoBoundingBox *boundingBox =
[NMAGeoBoundingBox
geoBoundingBoxWithTopLeft:topLeft bottomRight:bottomRight];
HERE iOS SDK Developer's Guide
► User Guide
47
NMAGeocodeRequest* request = [[NMAGeocoder sharedGeocoder]
createGeocodeRequestWithQuery:@"100 INVALIDENSTRASSE"
searchArea:boundingBox
locationContext:nil];
// limit the number of results to 10
request.collectionSize = 10;
NSError* error = [request startWithListener:self];
if (error.code != NMARequestErrorNone)
{
// Handle request error
...
}
}
@end
The NMAReverseGeocodeRequest interface
The
NMAReverseGeocodeRequest
interface represents an extended
NMARequest
used to retrieve
NMAPlaceLocation
data. The request is created using an
NMAGeoCoordinates
as shown below:
NMAGeocodeRequest* request = [[NMAGeocoder sharedGeocoder]
createReverseGeocodeRequestWithGeoCoordinates:geoCoordinates];
The above method returns an
NMAReverseGeocodeRequest
object. Reverse geocode requests are used in the same way as regular geocode requests (described in the previous section), but the results are returned as an array of
NMAReverseGeocodeResult
objects.
The following example shows how to create and use an
NMAReverseGeocodeRequest
:
// Implementation of NMAResultListener
@interface NMAReverseGeocodeTest : NSObject<NMAResultListener> {
}
@implementation NMAReverseGeocodeTest
// NMAResultListener protocol callback implementation
- (void)request:(NMARequest*)request
didCompleteWithData:(id)data
error:(NSError*)error
{
if ( ( [request isKindOfClass:[NMAReverseGeocodeRequest class]]) ) &&
( error.code == NMARequestErrorNone ) )
{
// Process result NSArray of NMAReverseGeocodeResult objects
[self processResult:(NSMutableArray *)data];
}
else
{
// Handle error
...
}
}
- (void) startSearch
{
// Instantiate an Address object
NMAGeoCoordinates* vancouver = [[NMAGeoCoordinates alloc] initWithLatitude:49.2849
longitude:-123.1252];
HERE iOS SDK Developer's Guide
► User Guide
48
NMAReverseGeocodeRequest* request = [[NMAGeocoder sharedGeocoder]
createReverseGeocodeRequestWithGeoCoordinates:vancouver];
NSError* error = [request startWithListener:self];
if (error.code != NMARequestErrorNone)
{
// Handle request error
...
}
}
@end
For more information about the APIs introduced and demonstrated in this section, refer to the
API
Reference documentation
.
Search and Discovery
The HERE iOS SDK includes a Places API which provides functionality to search, discover, and obtain more information about places in the real world.
HERE Places helps to determine whether a business meets your needs through reviews and photos from real people. In addition to basic information such as opening hours and contact details, HERE
Places can also include editorials from popular guides to help identify the best Places for you to visit.
Steps for Performing a Search
1. Implement the
NMAResultListener
protocol to handle the completion of the search
2. Create a request using the
NMAPlaces
factory
3. Invoke the request by calling
NMARequest startWithListener:
4. The
NMAResultListener request:didCompleteWithData:error:
callback is triggered when the request is finished
Note: Generally, applications that use the Places API must honor the following prescribed workflow:
1. Search
2. Request for Details
3. Perform Actions
Do not preload results that are linked from a response in order to improve performance, as doing so violates HERE's guidelines. For more information about usage restrictions, consult the
API Implementation Check List
section in the Places RESTful API documentation.
Discovery Requests
The HERE Places API supports the following discovery requests:
• Search - finds places that match user-provided search terms.
HERE iOS SDK Developer's Guide
► User Guide
49
• Explore - finds interesting places nearby, or in the map viewport, sorted by popularity. Use this type of request if you are trying to answer the question "What are the interesting places near here?" The results may be optionally restricted to a given set of categories, which acts as a filter in terms of what places get returned.
• Here - helps users identify places at the given location by finding places of interest near a given point, sorted by distance. Use this type of request if you are trying to answer the question "What is near this location?" or "Where am I?" You can use this endpoint to implement features like
"check-in" (by identifying places at the user's current position) or "tap to get more information about this place of interest".
• Around - allows users to request places near to a given point, based on a location precision parameter. The places around that point are returned in order of proximity. This type of request is intended for applications that employ features such as augmented reality, where places around the user's location are displayed on a device. It is intended to provide places that are likely to be visible to the user as well as important places that are farther away.
Note: The Around request is currently considered experimental, and its behavior and functionality are still evolving. Please check future documentation for further updates to this feature.
The
NMAPlaces
interface represents a search request factory. Use the following methods to create new discovery requests:
[[NMAPlaces sharedPlaces] createSearchRequestWithLocation:location
query:query]]
[[NMAPlaces sharedPlaces] createExploreRequestWithLocation:location
searchArea:geoArea
filters:filters]]
[[NMAPlaces sharedPlaces] createHereRequestWithLocation:location
filters:filters]]
[[NMAPlaces sharedPlaces] createAroundRequestWithLocation:location
searchArea:geoArea
filters:filters]]
The following code example demonstrates how to perform a search discovery request.
You need to implement the
NMAResultListener
protocol by implementing the request:didCompleteWithData:error
callback method, and also initialize the request by calling request startWithListener:
:
// Sample Search request listener
@interface NMASearchTest : NSObject<NMAResultListener> {
NMADiscoveryPage* _result;
}
@implementation NMASearchTest
HERE iOS SDK Developer's Guide
► User Guide
// NMAResultListener protocol callback implementation
- (void)request:(NMARequest*)request
didCompleteWithData:(id)data
error:(NSError*)error
{
if ( ( [request isKindOfClass:[NMADiscoveryRequest class]]) ) &&
( error.code == NMARequestErrorNone ) )
{
// Process result NMADiscoveryPage objects
_result = (NMADiscoveryPage*) data;
}
else
{
// Handle error
...
}
}
- (void) startSearch
{
// Create a request to search for restaurants in Vancouver
NMAGeoCoordinates* vancouver =
[[NMAGeoCoordinates alloc] initWithLatitude:48.263392
longitude:-123.12203];
NMADiscoveryRequest* request =
[[NMAPlaces sharedPlaces] createSearchRequestWithLocation:vancouver
query:@"restaurant"]];
// optionally, you can set a bounding box to limit the results within it.
NMAGeoCoordinates *boundingTopLeftCoords = [[NMAGeoCoordinates alloc]
initWithLatitude:49.277484 longitude:-123.133693];
NMAGeoCoordinates *boundingBottomRightCoords = [[NMAGeoCoordinates alloc]
initWithLatitude:49.257209 longitude:-123.11275];
NMAGeoBoundingBox *bounding = [[NMAGeoBoundingBox alloc]
initWithTopLeft:boundingTopLeftCoords bottomRight:boundingBottomRightCoords];
request.viewport = bounding;
// limit number of items in each result page to 10
request.collectionSize = 10;
NSError* error = [request startWithListener:self];
if (error.code != NMARequestErrorNone)
{
// Handle request error
...
}
}
To ensure that your application get the best search results, you can set a location context to your search request by setting a bounding box to the viewport
property. In the previous example, you can also replace the
NMAGeoBoundingBox
with the viewport from
NMAMapView
.
The result of a search or explore discovery request is an
NMADiscoveryPage
. The
NMADiscoveryPage
represents a paginated collection of items from which the following can be retrieved:
• Next page request - an
NMADiscoveryRequest
used to retrieve additional pages of search items
• Items for the current page - an
NSArray
of
NMALink
, either
NMAPlaceLink
or
NMADiscoveryLink
50
HERE iOS SDK Developer's Guide
► User Guide
51
If
NMADiscoveryPage.nextPageRequest
is nil, no additional results are available.
The following is an example:
...
@interface NMANextPageTest : NSObject<NMAResultListener> {
NMADiscoveryPage* _page; // valid NMADiscoveryPage instance
}
@implementation NMANextPageTest
- (void)onNextPageAction
{
NSError* error = [_page.nextPageRequest startWithListener:self];
if ( error.code == NMARequestErrorNone] )
{
// More data is available
}
}
// NMAResultListener protocol callback implementation
- (void)request:(NMARequest*)request
didCompleteWithData:(id)data
error:(NSError*)error
{
if ( ( [request isKindOfClass:[NMADiscoveryRequest class]]) ) &&
( error.code == NMARequestErrorNone ) )
{
// Process NMADiscoveryPage objects
}
else
{
// Handle error
...
}
}
...
The
NMADiscoveryPage discoveryResults
property contains an array of
NMALink
objects. The items are actually a collection of
NMALink
subclasses:
•
NMAPlaceLink
- Represents discovery information about a
NMAPlace
. The
NMAPlaceLink contains a brief summary about a place. Details about a place are available from the
NMAPlace that the
NMAPlaceLink
references.
•
NMADiscoveryLink
- Represents a discovery-related API link used to retrieve additional
NMADiscoveryPage
instances. This type of
NMALink
can be a result item in an Explore or Here type of search. The
NMADiscoveryLink
references refine discovery requests resulting in more specific results. For example, the
NMADiscoveryLink
may link to a discovery request to search for 'Eat & Drink', 'Going Out', 'Accommodation', and so on.
It is recommended that each type of
NMADiscoveryPage
be checked before it is used. In the following example, it is shown how an
NMAPlace
is retrieved through a
NMAPlaceLink
:
@interface NMASearchTest : NSObject<NMAResultListener> {
NMADiscoveryPage* _result;
}
@implementation NMASearchTest
HERE iOS SDK Developer's Guide
► User Guide
// Retrieve the place details when the user selects a displayed PlaceLink.
- (void)onPlaceLinkSelected(NMAPlaceLink*)placeLink
{
NSError* error = [[placeLink detailsRequest] startWithListener:self];
if ( error.code == NMARequestErrorNone] )
{
// More data will available.
...
}
}
// NMAResultListener protocol callback implementation
- (void)request:(NMARequest*)request
didCompleteWithData:(id)data
error:(NSError*)error
{
if ( ( [request isKindOfClass:[NMADiscoveryRequest class]]) ) &&
( error.code == NMARequestErrorNone ) )
{
_result = (NMADiscoveryPage*) data;
NSArray* discoveryResult = _result.discoveryResults;
for ( NMALink* link in discoveryResult )
{
if ( link isKindOfClass:[NMADiscoveryLink class] )
{
NMADiscoveryLink* discoveryLink = (NMADiscoveryLink*) link;
// NMADiscoveryLink can also be presented to the user.
// When a NMADiscoveryLink is selected, another search request should be
// performed to retrieve results for a specific category.
...
}
else if ( link isKindOfClass:[NMAPlaceLink class]] )
{
NMAPlaceLink* placeLink = (NMAPlaceLink*) link;
// NMAPlaceLink should be presented to the user, so the link can be
// selected in order to retrieve additional details about a place
// of interest.
...
}
}
}
else if ( ( [request isKindOfClass:[NMAPlaceRequest class]]) ) &&
( error.code == NMARequestErrorNone ) )
{
NMAPlace* place = (NMAPlace*)data;
// Access to additional details about a place of interest.
}
else
{
// Handle error
...
}
}
The NMAPlace Class
The
NMAPlace
class represents a detailed set of data about a physical place, acting as a container for various attributes, collections of media about a place, and key-value pairs of related places. An
NMAPlace
object can belong to a specific
NMACategory
, and has the following attributes:
• a unique identifier (ID)
52
HERE iOS SDK Developer's Guide
► User Guide
53
• a name
• a localized name (optional)
• an
NMAPlaceLocation
object representing the physical location of the place.
NMAPlaceLocation
also contains a street address and a list of the geocoordinate positions to access this place.
• an array of
NMACategory
objects that link to the categories assigned to the place
• an
NMALink
object containing a link to the origin of supplied information, typically a website of the supplier
• an
NSString
representing a URL to an icon (optional)
• an
NMALink
object containing a link to the supplier's brand icon (optional)
• an attribution
NSString
, such as reviewer name
• an array of
NMAExtendedAttribute
objects containing attribute information (optional)
• an
NMAMediaCollectionPage
of
NMAMediaRating
objects, representing ratings from different media sources (optional)
• an
NMARatings
, representing the average user rating for this place (optional)
• an
NMAMediaCollectionPage
of
NMAImageContent
objects (optional)
• an array of
NMAContactDetail
objects (optional)
• an
NMAMediaCollectionPage
of
NMAReviewContent
objects (optional)
• an
NMAMediaCollectionPage
of
NMAEditorialContent
objects (optional)
• an
NSDictionary
of
NMALink
objects specifying related places (optional)
• an
NMALink
object containing a link for reporting place data issues (optional)
Note: Since the icon URL for an
NMAPlace
is optional, you can use the icon URL that is associated with one of the
NMAPlace
's
NMACategory
instances to visually represent the place instead.
Category Filters
A place of interest can be associated with categories such as museum, restaurant, and coffee shop.
While creating an Explore or Here discovery request, you can choose to provide category filters in order to get a more specific set of results. For example, you may want to search for sushi restaurants near the Vancouver city hall.
To get a list of categories, call the topLevelCategories
method in
NMAPlaces
. From this list of categories, you can then retrieve one or more level of sub-categories. For example, "Bars/
Pubs" under the "Restaurant" category. Once you have the categories, you can then create an
HERE iOS SDK Developer's Guide
► User Guide
54
NMACategoryFilter
object and call the addCategoryFilterFromUniqueId
method. Note that each
NMACategoryFilter
object can represent multiple categories.
NSArray* categories = [[NMAPlaces sharedPlaces] topLevelCategories]; for (id category in categories)
{
if (category.uniqueid = "restaurant" )
{
NMACategory* restCategory = category;
NMAGeoCoordinates* vancouver = [[NMAGeoCoordinates alloc]
initWithLatitude:47.592229
longitude:-122.315147];
NMACategoryFilter *categoryFilter = [NMACategoryFilter new];
[categoryFilter addCategoryFilterFromUniqueId:restCategory.uniqueId];
NMADiscoveryRequest* request = [ [NMAPlaces sharedPlaces]
createHereRequestWithLocation:vancouver
filters:categoryFilter];
//...
}
}
Additional Search Requests
The HERE Places Search API also supports the following related request type:
•
Text suggestion - retrieves a list of suggested search terms that are related to a specified location context and a partial search term. For example, if you make a request with the String
"rest" in Berlin, the results then contain search terms such as "Restaurant", "Rest area", and
"Restorf, Höhbeck, Germany".
To use text suggestions, implement a listener to handle a list of
NSString
and call createSuggestionRequestWithLocation
as follows:
// Sample Search request listener
@interface NMATextSuggestionSearchTest : NSObject<NMAResultListener> {
}
@implementation NMATextSuggestionSearchTest
// NMAResultListener protocol callback implementation
- (void)request:(NMARequest*)request
didCompleteWithData:(id)data
error:(NSError*)error
{
if ( ( [request isKindOfClass:[NMASuggestionRequest class]]) ) &&
( error.code == NMARequestErrorNone ) )
{
// Results are held in an array of NSString
NSArray* textSuggestionResult = (NSArray*) data;
}
else
{
// Handle error
...
}
HERE iOS SDK Developer's Guide
► User Guide
}
- (void) startSearch
{
NMAGeoCoordinates* vancouver =
[[NMAGeoCoordinates alloc] initWithLatitude:47.592229
longitude:-122.315147];
NMASuggestionRequest* request =
[[NMAPlaces sharedPlaces] createSuggestionRequestWithLocation:vancouver
partialTerm:@"rest"]];
// limit number of items in each result page to 10
request.collectionSize = 10;
NSError* error = [request startWithListener:self];
if (error.code != NMARequestErrorNone)
{
// Handle request error
...
}
}
55
HERE iOS SDK Developer's Guide
► Supplemental Information
56
Chapter
4
Supplemental Information
Topics:
•
•
This section provides supplemental information for using the HERE iOS SDK.
HERE iOS SDK Developer's Guide
► Supplemental Information
57
Creating a Simple HERE SDK Application Using Swift
This tutorial provides instructions on how to create a simple application using the
Swift programming language
. It is equivalent to the Objective-C tutorial, which is located at
Development tasks for this basic application include:
• Create a new Xcode project
• Add necessary resources and a map view to the project
• Acquire credentials from HERE for accessing map services
• Initialize the map view such that a map instance is created for rendering on the client device
The contents of this guide apply to Xcode 7.0 and the iOS 9 SDK.
Create a New Single View Application
1. From XCode menu, select File > New > Project to open the New project dialog (or press Shift +
Command + N).
2. Select iOS > Application > Single View Application as the application type you want to create.
Press Next.
3. In the next dialog, enter your Product Name (such as
HelloMap
) and
Organization Identifier
(such as edu.self
). Choose "Swift" under Language, then choose "iPhone" under Devices, then click Next.
4. Navigate to the directory where you want your project to be stored and then select Create.
5. The next step is to configure this project to use the HERE SDK.
Configure the Application
1. Extract the HERE iOS SDK archive to somewhere in your local file system.
2. Add the
NMAKit
framework and bundle to your Xcode project. To add the
NMAKit
framework to your Xcode project, open the add files dialog. Select
File > Add Files To [Project Name], then select the "NMAKit.framework" folder. Ensure that the "Create folder references" option is selected, then select
Add.
HERE iOS SDK Developer's Guide
► Supplemental Information
Note: Dragging the NMAKit framework directory from the Finder into your project also has the same effect.
Figure 18: Add File to Target
58
3. Do the same for the
NMABundle.bundle
file. This file is found in the
HelloMap/
NMAKit.framework/Resource
directory. However, do
not
select the "Copy items if needed" option.
4. Next, add the NMAKit dependencies to your Xcode project. The NMAKit has a number of dependencies on other frameworks and libraries. Ensure that the items in the following list are present in the
Targets > Build Phases > Link Binary With Libraries section. If they are not present, add them using the + sign button. You can find this section by clicking on your project, in the Project Navigator and then selecting the
Build Phases tab in the Standard Editor.
• libc++.dylib
• GLKit.framework
• SystemConfiguration.framework
5. Run the application. From the Xcode menu bar, select Product > Run. Ensure that the project runs in the iOS Simulator without errors.
6. The HERE iOS SDK is now ready for use in your Xcode project. Now that you have your project configured to work with the HERE SDK, try extending the sample application to render a map.
Create the Map View
In this section, we utilize the
NMAMapView
and
NMAGeoCoordinates
classes to render a Map.
1. Create a bridging header file for
NMAKit
.
a. From the Xcode menu bar, select File > New > File...
b. Select "Header File" and click Next.
c. In the Save sheet, leave the file location as the
HelloMap
folder and set the file name, such as
Header
. Click "Create".
HERE iOS SDK Developer's Guide
► Supplemental Information
59
d. Replace the entire contents of the header file with the following:
#import <NMAKit/NMAKit.h>
e. Next, left-click on the project name (
HelloMap
) in the Project Navigator. Click on "Build
Settings".
f. Under the "Swift Compiler - Code Generation" section, double-click on the entry for
"Objective-C Bridging Header" and enter the following:
$(SRCROOT)/$(PROJECT_NAME)/Header.h
2. Create an
NMAMapView
.
a. Select
Main.storyboard
in the navigator, then open the Utilities view by pressing the key combination Command + Option + Control + 3. Drag and drop a View object from the
Object Library onto the View Controller. If necessary, resize the View so it takes up the entire viewable area.
b. In the Interface Builder, click on the created View and then open the Identity Inspector in the Utilities view by pressing the key combination Command + Option + 3. Change the class
HERE iOS SDK Developer's Guide
► Supplemental Information
value from
UIView
to
NMAMapView
and press return. In the Document Outline, you should see that the name of the View has changed from to
View
to
Map View
.
Figure 19: MapView
60
3. Create an outlet to
NMAMapView
in
ViewController
.
a. Select
Main.storyboard
in the navigator.
b. Press Command + Option + Return to open the Assistant Editor. It should show
ViewController.swift
.
c. Hold the Control key on the keyboard and click to drag from the Map View to the interface block in
ViewController.swift
. You should see a blue line and tooltip which says "Insert Outlet or Outlet Connection". Release the mouse button and a dialog appears, allowing you to create an outlet.
HERE iOS SDK Developer's Guide
► Supplemental Information
d. Name the outlet
mapView
, keep the other default options and then select Connect.
Figure 20: Create an Outlet
61
4. Now an outlet to
NMAMapView
is set. The modified file should be as follows: import UIKit class ViewController: UIViewController {
@IBOutlet weak var mapView: NMAMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
5. Implement
NMAMapView
setup and lifecycle code by replacing the viewDidLoad()
function with viewWillAppear(animated)
and addMapCircle()
: override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
mapView.useHighResolutionMap = true
var coordinates: NMAGeoCoordinates
coordinates = NMAGeoCoordinates(latitude: 49.258867, longitude: -123.008046)
mapView.zoomLevel = 13.2
mapView.setGeoCenter(coordinates, withAnimation: NMAMapAnimation.Linear)
mapView.copyrightLogoPosition = NMALayoutPosition.BottomCenter
addMapCircle()
} func addMapCircle() {
if mapCircle == nil {
HERE iOS SDK Developer's Guide
► Supplemental Information
62
let coordinates: NMAGeoCoordinates =
NMAGeoCoordinates(latitude: 49.258867, longitude: -123.008046)
mapCircle = NMAMapCircle(geoCoordinates: coordinates, radius: 50)
mapView.addMapObject(mapCircle)
}
}
6. Add your HERE application credentials.
a. Open the
AppDelegate.swift
file.
b. Add the following in the application(_:didFinishLaunchingWithOptions)
function, replacing
YOUR_APP_ID
and
YOUR_APP_CODE
with the credentials that you received from your
http://developer.here.com
.
NMAApplicationContext.setAppId("YOUR_APP_ID", appCode: "YOUR_APP_CODE")
HERE iOS SDK Developer's Guide
► Supplemental Information
63
7. Build and run the application. If the build is successful, you now have an application that displays a map similar to the following screenshot and allows you to manipulate it using gestures.
Figure 21: Running the App
Supported Thread Usage
Developers should be aware of the following threading guidelines while using the HERE iOS SDK:
• All
NMA
interface methods are designed to be called from the main thread.
• All
NMA
protocol callbacks and blocks are dispatched to the main thread.
HERE iOS SDK Developer's Guide
► Supplemental Information
64
• Any exceptions to this rule are clearly documented in the applicable protocol or block definition.
HERE iOS SDK Developer's Guide
► Coverage Information
65
Chapter
5
Coverage Information
Feature support in the HERE iOS SDK may differ depending on the language and locale. For more information, please see:
HERE
Platform Coverage Information
HERE iOS SDK Developer's Guide
► API reference
Chapter
6
API reference
Topics:
•
•
•
•
The HERE iOS SDK allows you to add HERE Maps, Routing and
Search functionality to your iOS applications. The following pages provide a detailed reference to the packages and classes that make up the SDK.
66
HERE iOS SDK Developer's Guide
► API reference
67
NMA Common
Group Summary
group
NMA Common
The Common group includes classes, protocols, and enumerations that are generally used by other packages in the iOS SDK.
[For complete information, see the section
]
Nested Classes
Table 1: Public Nested Classes
Public Nested Classes
Public Enumeration Summary
Table 2: Public Enumeration
Public Enumeration
Represents fixed locations or regions within a bounding rectangle.
Error codes that may be returned from places search requests.
Attributes of a road element.
HERE iOS SDK Developer's Guide
► API reference
Public Enumeration
Plural type identifies when a Junction is made up of multiple Road Elements. It also implies that a maneuver may require different explication than implied by the geometry.
Road element classifications.
Public Variable Summary
Table 3: Public Variable
Public Variable
const double
A constant used to indicate an unknown measurement value
FOUNDATION_EXPORT const NSUInteger
FOUNDATION_EXPORT const NSUInteger
Upper limit of the NMAMapView zoomLevel property
Lower limit of the NMAMapView zoomLevel property
FOUNDATION_EXPORT NSString *const
NMAPositioningManagerDidLosePositionNotification
currentPosition has been lost.
FOUNDATION_EXPORT NSString *const
NMAPositioningManagerDidUpdatePositionNotification
Group Details
The Common group includes classes, protocols, and enumerations that are generally used by other packages in the iOS SDK. Some important classes in this group are
and
.
Public Enumeration Details
NMALayoutPosition
Include:
NMAKit.framework/headers/NMATypes.h
Represents fixed locations or regions within a bounding rectangle.
68
HERE iOS SDK Developer's Guide
► API reference
Enumeration Members:
•
NMALayoutPositionTopLeft
•
NMALayoutPositionTopCenter
•
NMALayoutPositionTopRight
•
NMALayoutPositionCenterLeft
•
NMALayoutPositionCenter
•
NMALayoutPositionCenterRight
•
NMALayoutPositionBottomLeft
•
NMALayoutPositionBottomCenter
•
NMALayoutPositionBottomRight
NMARequestError
Include:
NMAKit.framework/headers/NMATypes.h
Error codes that may be returned from places search requests.
Enumeration Members:
•
NMARequestErrorNone
No error.
•
NMARequestErrorUnknown
Unknown error.
•
NMARequestErrorAddressMissing
Request is missing an address parameter.
•
NMARequestErrorLocationContextInvalid
Location context is invalid.
•
NMARequestErrorLocationContextMissing
Request is missing location context parameter.
•
NMARequestErrorCountryCodeMissing
Request is missing a country code in the address parameter.
•
NMARequestErrorSearchTextMissing
Request missing search text parameter.
•
NMARequestErrorInvalidParameter
Invalid query parameter.
•
NMARequestErrorNetworkCommunication
Network communications error.
69
HERE iOS SDK Developer's Guide
► API reference
•
NMARequestErrorNetworkServer
Backend server unreachable.
•
NMARequestErrorNetworkEmptyInput
Request input missing.
•
NMARequestErrorInvalidCredentials
Application ID and/or token are missing or invalid.
•
NMARequestErrorHttp
Request failed due to an HTTP error.
•
NMARequestErrorNetworkUnknown
Unknown network error.
•
NMARequestErrorNotSupported
Functionality not supported.
•
NMARequestErrorNotReady
An entity is not ready. All poll functions return this when one needs to poll again. Also if an operation is in progress.
•
NMARequestErrorNotFound
When something was not found.
•
NMARequestErrorAlreadyExists
When resource already exists.
•
NMARequestErrorOutOfMemory
Out of memory.
•
NMARequestErrorOperationFailed
When operation fails (e.g.extracting of file failed)
•
NMARequestErrorAborted
Operation aborted by user.
•
NMARequestErrorFinderIndexFailure
Search index failure.
•
NMARequestErrorMovedPermanently
Resource moved (e.g. resource URI changed)
•
NMARequestErrorNotModified
Resource contend remains the same.
•
NMARequestErrorBadRequest
Invalid request (places component might need to be updated)
70
HERE iOS SDK Developer's Guide
► API reference
•
NMARequestErrorResourceGone
Resource no longer exists.
•
NMARequestErrorParse
An error occured during document parsing (json, etc.)
•
NMARequestErrorTimeout
Request timeout.
NMARoadElementAttribute
Include:
NMAKit.framework/headers/NMARoadElement.h
Attributes of a road element.
Enumeration Members:
•
NMARoadElementAttributeUndefined
•
NMARoadElementAttributeDirtRoad
Road type.
•
NMARoadElementAttributeUsageFeeRequired
•
NMARoadElementAttributeCarpool
•
NMARoadElementAttributeUrban
•
NMARoadElementAttributeTollroad
•
NMARoadElementAttributeNoThroughTraffic
•
NMARoadElementAttributeTunnel
•
NMARoadElementAttributeSliproad
•
NMARoadElementAttributeHighway
•
NMARoadElementAttributeUnderConstruction
•
NMARoadElementAttributeHasLaneDir
•
NMARoadElementAttributeHasLaneExit
•
NMARoadElementAttributeFerry
•
NMARoadElementAttributeRailFerry
NMARoadElementPluralType
Include:
NMAKit.framework/headers/NMARoadElement.h
Plural type identifies when a Junction is made up of multiple Road Elements. It also implies that a maneuver may require different explication than implied by the geometry.
Enumeration Members:
71
HERE iOS SDK Developer's Guide
► API reference
72
•
NMARoadElementPluralTypeNone
Junction is not plural.
•
NMARoadElementPluralTypeManeuver
Indicates that only one command should be given despite the fact that two Junctions occur – one at each end of the turn lane. It is only necessary to state "turn left/right" near the beginning of the maneuver because at the end the driver does not have a choice in direction.
•
NMARoadElementPluralTypeConnector
Indicates that a road segment should not be viewed as an individual piece of road but as part of the intersection. A separate guidance manoeuvre should not exist for this segment.
•
NMARoadElementPluralTypeIndeterminate
Indicates a maneuver that cannot be explained in one command or at all. A graphic may be needed to illustrate the turn. For example, a driver may need to go right to make a left turn.
NMARoadElementType
Include:
NMAKit.framework/headers/NMARoadElement.h
Road element classifications.
The NAMRoadElementType describes the nature of the road that a
is part of. A road element may only have one type, or none if the road is an unclassified type or the information is not available.
Enumeration Members:
•
NMARoadElementTypeUndefined
•
NMARoadElementTypeMotorway
•
NMARoadElementTypeMultiCarriageway
•
NMARoadElementTypeSingleCarriageway
•
NMARoadElementTypeRoundabout
•
NMARoadElementTypeSliproad
•
NMARoadElementTypePedestrianZone
•
NMARoadElementTypePedestrianWalkway
•
NMARoadElementTypeServiceAccessParking
•
NMARoadElementTypeServiceAccessOther
•
NMARoadElementTypeServiceRoad
HERE iOS SDK Developer's Guide
► API reference
Public Variable Details
const double NMAGeoPositionUnknownValue
Include:
NMAKit.framework/headers/NMAGeoPosition.h
A constant used to indicate an unknown measurement value.
FOUNDATION_EXPORT const NSUInteger NMAMapObjectMaximumZIndex
Include:
NMAKit.framework/headers/NMATypes.h
FOUNDATION_EXPORT const NSUInteger NMAMapObjectMinimumZIndex
Include:
NMAKit.framework/headers/NMATypes.h
The minimum Z Index for an
FOUNDATION_EXPORT const float NMAMapViewMaximumZoomLevel
Include:
NMAKit.framework/headers/NMATypes.h
zoomLevel property.
FOUNDATION_EXPORT const float NMAMapViewMinimumZoomLevel
Include:
NMAKit.framework/headers/NMATypes.h
Lower limit of the
FOUNDATION_EXPORT NSString
*const NMAPositioningManagerDidLosePositionNotification
Include:
NMAKit.framework/headers/NMAPositioningManager.h
currentPosition has been lost.
In order to receive this notification, register with NSNotificationCenter using this notification name
sharedPositioningManager] instance as the object (notification sender).
73
HERE iOS SDK Developer's Guide
► API reference
FOUNDATION_EXPORT NSString
*const NMAPositioningManagerDidUpdatePositionNotification
Include:
NMAKit.framework/headers/NMAPositioningManager.h
currentPosition has changed.
Notifications In order to receive this notification, register with
NSNotificationCenter using this notification name and the [
sharedPositioningManager] instance as the object (notification sender).
NMAApplicationContext
Class Summary
class
NMAApplicationContext
Derived from: NSObject
.
Include:
NMAKit.framework/headers/NMAApplicationContext.h
Inheritance Diagrams
Figure 22: Public inheritance diagram for NMAApplicationContext
74
[For complete information, see the section
]
Class Method Summary
Table 4: Class Method
Class Methods
Return the SDK version.
HERE iOS SDK Developer's Guide
► API reference
Class Methods
+(void)
(NSString *) appId appCode:(NSString *) appCode
Sets the mandatory HERE Authentication Credentials
Class Details
Use this interface to set mandatory authentication crendentials
Note:
YOU MUST SET AUTHENTICATION CREDENTIALS in order to use the APIs contained within this
SDK. Some APIs may appear to work without valid credentials but they may stop functioning in the near future when server side configurations change, so please obtain and use valid credentials.
Class Method Details
+(NSString *) sdkVersion
Return the SDK version.
Returns:
The SDK verion
+(void) setAppId:(NSString *) appId appCode:(NSString *) appCode
Sets the mandatory HERE Authentication Credentials.
These credentials MUST be set in order to use the APIs in this SDK. It is recommended to set the credentials in your application delegate, such as in [UIApplicationDelegate didFinishLaunchingWithOptions]
NMAGeoBoundingBox
Class Summary
class
NMAGeoBoundingBox
Derived from: NSObject
Represents a bounding box that defines a rectangular area in a geographic coordinate system.
75
HERE iOS SDK Developer's Guide
► API reference
Include:
NMAKit.framework/headers/NMAGeoBoundingBox.h
Inheritance Diagrams
Figure 23: Public inheritance diagram for NMAGeoBoundingBox
[For complete information, see the section
]
Public Property Summary
Table 5: Public Property
Public Property
[readable, writable, strong]
The NMAGeoCoordinates representing the bottom-left corner of the NMAGeoBoundingBox
[readable, writable, strong]
The NMAGeoCoordinates representing the bottom-right corner of the NMAGeoBoundingBox
[readable, weak]
The NMAGeoCoordinates representing the center of the NAMGeoBoundingBox
[readable, assign]
[readable, assign]
The NMAGeoBoundingBox height, in degrees
[readable, writable, strong]
The NMAGeoCoordinates representing the top-left corner of the NMAGeoBoundingBox
[readable, writable, strong]
The NMAGeoCoordinates representing the top-right corner of the NMAGeoBoundingBox
[readable, assign]
The NMAGeoBoundingBox width, in degrees
76
HERE iOS SDK Developer's Guide
► API reference
77
Instance Method Summary
Table 6: Instance Method
Instance Methods
-(BOOL)
(
*) boundingBox
Determines whether the specified NMAGeoBoundingBox is covered entirely by this NMAGeoBoundingBox (boundary included)
-(BOOL)
(
*) coordinates
Determines whether the specified NMAGeoCoordinates object is contained within this NMAGeoBoundingBox (boundary included)
*) topLeft bottomRight:(
*) bottomRight
Initializes a NMAGeoBoundingBox instance with specified top-left and bottom-right NMAGeoCoordinates
-(
intersectionWithGeoBoundingBox:
(
*) boundingBox
Computes the intersection of this and another NMAGeoBoundingBox
-(BOOL)
Determines whether the intesection of this NMAGeoBoundingBox and the specified NMAGeoBoundingBox is non-empty
-(BOOL)
Determines whether the size of the enclosed NMAGeoBoundingBox is 0
-(BOOL)
*) boundingBox
Determines whether this NMAGeoBoundingBox is equal to another
Class Method Summary
Table 7: Class Method
Class Methods
geoBoundingBoxContainingGeoBoundingBoxes:
Constructs a NMAGeoBoundingBox which contains all bounding boxes in an array.
geoBoundingBoxContainingGeoCoordinates:
(NSArray *) coordinates
Constructs a NMAGeoBoundingBox which contains all coordinates in an array.
(
*) center width:(double) width height:(double) height
Constructs a NMAGeoBoundingBox from a NMAGeoCoordinates center point and a height and width in degrees
HERE iOS SDK Developer's Guide
► API reference
78
Class Methods
*) topLeft bottomRight:(
*) bottomRight
Constructs a NMAGeoBoundingBox from NMAGeoCoordinates defining its top left and bottom right corners
*) bottomLeft
Constructs a NMAGeoBoundingBox from NMAGeoCoordinates defining its top right and bottom left corners
Class Details
Represents a bounding box that defines a rectangular area in a geographic coordinate system.
Although the bounding box is specified by its top-left and bottom-right corner, the box is not necessarily the smallest rectangle spanned by these two points. It is possible to define bounding boxes that are wider than 180 degrees or higher than 90 degrees (e.g. by set ting the longitude of top-left corner to a bigger value than the longitude of the bottom-right corner).
For example, a bounding box with a longitude of -180 degrees for the top- left corner and a longitude of 180 degrees for the bottom-right corner will construct an area the encircles the globe, whereas a bounding box with the same longitude values for both corners will construct a bounding box with a width of 0 degrees.
Public Property Details
[readable, writable, strong]
The NMAGeoCoordinates representing the bottom-left corner of the NMAGeoBoundingBox.
[readable, writable, strong]
The NMAGeoCoordinates representing the bottom-right corner of the NMAGeoBoundingBox.
[readable, weak]
The NMAGeoCoordinates representing the center of the NAMGeoBoundingBox.
[readable, assign]
BOOL crossesInternationalDateLine
crosses the international date line
HERE iOS SDK Developer's Guide
► API reference
[readable, assign] double height
The NMAGeoBoundingBox height, in degrees.
[readable, writable, strong]
The NMAGeoCoordinates representing the top-left corner of the NMAGeoBoundingBox.
[readable, writable, strong]
The NMAGeoCoordinates representing the top-right corner of the NMAGeoBoundingBox.
[readable, assign] double width
The NMAGeoBoundingBox width, in degrees.
Instance Method Details
-(BOOL) containsGeoBoundingBox:(
Determines whether the specified NMAGeoBoundingBox is covered entirely by this
NMAGeoBoundingBox (boundary included).
Parameters:
•
boundingBox
A NMAGeoBoundingBox to check for containment within this NMAGeoBoundingBox
Returns:
YES if contained within the NMAGeoBoundingBox, NO otherwise
-(BOOL) containsGeoCoordinates:(
Determines whether the specified NMAGeoCoordinates object is contained within this
NMAGeoBoundingBox (boundary included).
Parameters:
•
coordinates
79
HERE iOS SDK Developer's Guide
► API reference
80
A NMAGeoCoordindates object to check for containment within this NMAGeoBoundingBox
Returns:
YES if contained within the NMAGeoBoundingBox, NO otherwise
-(instancetype) initWithTopLeft:(
Initializes a NMAGeoBoundingBox instance with specified top-left and bottom-right
NMAGeoCoordinates.
Parameters:
•
topLeft
A top-left NMAGeoCoordinates value for the new NMAGeoBoundingBox
•
bottomRight
A bottom-right NMAGeoCoordinates value for the new NMAGeoBoundingBox
Returns:
The NMAGeoBoundingBox
-(
*) intersectionWithGeoBoundingBox:(
*) boundingBox
Computes the intersection of this and another
.
Note:
The interection may have zero area.
Parameters:
•
boundingBox
to intersect with
Returns:
The
representing the intersection, or nil if the boxes do not uniquely intersect
-(BOOL) intersectsGeoBoundingBox:(
HERE iOS SDK Developer's Guide
► API reference
Determines whether the intesection of this NMAGeoBoundingBox and the specified
NMAGeoBoundingBox is non-empty.
Parameters:
•
boundingBox
A NMAGeoBoundingBox to check for intersection with this NMAGeoBoundingBox
Returns:
YES if the intersection of NMAGeoBoundingBox objects is non-empty, NO otherwise
-(BOOL) isEmpty
Determines whether the size of the enclosed NMAGeoBoundingBox is 0.
Returns:
YES if the size of the enclosed area is 0, NO otherwise
-(BOOL) isEqualToGeoBoundingBox:(
Determines whether this
Returns:
YES if the bounding boxes are equal, NO otherwise
Class Method Details
+(instancetype) geoBoundingBoxContainingGeoBoundingBoxes:(NSArray *) boxes
Constructs a NMAGeoBoundingBox which contains all bounding boxes in an array.
will be the smallest possible box which contains all the
NMAGeoBoundingBoxes in the input array.
Parameters:
•
boxes
A NSArray of
defining the new NMAGeoBoundingBox
Returns:
The NMAGeoBoundingBox
81
HERE iOS SDK Developer's Guide
► API reference
82
+(instancetype) geoBoundingBoxContainingGeoCoordinates:(NSArray *)
coordinates
Constructs a NMAGeoBoundingBox which contains all coordinates in an array.
will be the smallest possible box which contains all the
in the input array.
Parameters:
•
coordinates
A NSArray of
defining the new NMAGeoBoundingBox
Returns:
The NMAGeoBoundingBox
+(instancetype) geoBoundingBoxWithCenter:(
width:(double) width height:(double) height
Constructs a NMAGeoBoundingBox from a
center point and a height and width
in degrees.
Note:
If the specified values produce a box with top edge latitude > 90 or bottom edge latitude <
-90, the box will be clamped to that range. If the top edge latitude is less than the bottom edge latitude, nil will be returned.
Parameters:
•
center
representing the center of the bounding box
•
width
The width of the bounding box in degrees longitude
•
height
The height of the bounding box in degrees latitude
Returns:
The NMAGeoBoundingBox if the inputs are valid, else nil
HERE iOS SDK Developer's Guide
► API reference
83
+(instancetype) geoBoundingBoxWithTopLeft:(
bottomRight:(
Constructs a NMAGeoBoundingBox from
defining its top left and bottom right corners.
Parameters:
•
topLeft
representing the top left corner of the bounding box
•
bottomRight
representing the bottom right corner of the bounding box
Returns:
The NMAGeoBoundingBox
+(instancetype) geoBoundingBoxWithTopRight:(
bottomLeft:(
Constructs a NMAGeoBoundingBox from
defining its top right and bottom left corners.
Parameters:
•
topRight
representing the top right corner of the bounding box
•
bottomLeft
representing the bottom left corner of the bounding box
Returns:
The NMAGeoBoundingBox
NMAGeoCoordinates
Class Summary
class
NMAGeoCoordinates
Derived from: NSObject
HERE iOS SDK Developer's Guide
► API reference
Represents WGS84 coordinates with double precision.
Include:
NMAKit.framework/headers/NMAGeoCoordinates.h
Inheritance Diagrams
Figure 24: Public inheritance diagram for NMAGeoCoordinates
84
[For complete information, see the section
]
Public Property Summary
Table 8: Public Property
Public Property
[readable, writable, assign]
measured in meters above sea-level.
[readable, writable, assign] double
The latitude, as measured in degrees, representing north-south coordinate (y-axis on a map)
[readable, writable, assign] double
The longitude, as measured in degrees, representing east-west coordinate (x-axis on a map)
Instance Method Summary
Table 9: Instance Method
Instance Methods
(
*) coordinates
Calculates (using the Haversine formula) the distance in meters between this NMAGeoCoordinates instance and the specified
NMAGeoCoordinates
(
*) coordinates
Calculates the heading in degrees from this NMAGeoCoordinates instance to the specified NMAGeoCoordinates instance
(double) latitude longitude:(double) longitude
Initializes a NMAGeoCoordinates instance with specified latitude and longitude values and zero altitude
HERE iOS SDK Developer's Guide
► API reference
85
Instance Methods
(double) latitude longitude:(double) longitude altitude:(float)
altitude
Initializes a NMAGeoCoordinates instance with specified values for the initial latitude, longitude and altitude
-(BOOL)
*) coordinates
Determines whether this NMAGeoCoordinates is equal to another
Class Method Summary
Table 10: Class Method
Class Methods
(double) latitude longitude:(double) longitude
Constructs a NMAGeoCoordinates with the specified latitude and longitude
(double) latitude longitude:(double) longitude
altitude:(double) altitude
Constructs a NMAGeoCoordinates with the specified latitude, longitude, and altitude
Class Details
Represents WGS84 coordinates with double precision. A NMAGeoCoordinates encapsulates a latitude and longitude value, plus an optional altitude value.
Note:
Although NMAGeoCoordinates are accepted and handled with double precision
(about 15 significant digits), the real precision of rendering operations such as
NMAMapView::setCenterAt
might be lower due to internal conversions. Overall precision of
NMAGeoCoordinates can be assured for only six digits following the decimal point.
Public Property Details
[readable, writable, assign] float altitude
The altitude of the
measured in meters above sea-level.
By default, the plane of the map is at 0 meters. Thus, geocoordinates with positive altitudes represent points above the plane of the map, while negative altitudes are below the plane of the map.
Note:
HERE iOS SDK Developer's Guide
► API reference
Valid values are in the range [-10000.0, 10000.0]. If an invalid value is specified, it will be adjusted to the closest possible valid value (e.g. a specified value of -10200.0 will be set to
-10000.0).
[readable, writable, assign] double latitude
The latitude, as measured in degrees, representing north-south coordinate (y-axis on a map).
Note:
The latitude must be in the range [-90, 90]. Values outside this range will be clamped.
[readable, writable, assign] double longitude
The longitude, as measured in degrees, representing east-west coordinate (x-axis on a map).
Note:
The longitude must be in the range [-180, 180]. Values outside this range will be wrapped. For example, a value of 200 degrees will be wrapped to -160.
Instance Method Details
-(double) distanceTo:(
Calculates (using the Haversine formula) the distance in meters between this NMAGeoCoordinates instance and the specified NMAGeoCoordinates.
Parameters:
•
coordinates
A second NMAGeoCoordinates some distance away
Returns:
The distance between the NMAGeoCoordinates, or -DBL_MAX if the coordinates
parameter is nil
-(double) headingTo:(
Calculates the heading in degrees from this NMAGeoCoordinates instance to the specified
NMAGeoCoordinates instance.
Parameters:
86
HERE iOS SDK Developer's Guide
► API reference
•
coordinates
to which to the heading is calculated.
Returns:
Heading from this coordinate to the given coordinate, in degrees. 0 = north, increasing clockwise. If coordinates is nil or invalid a negative result will be returned to indicate an error.
-(id) initWithLatitude:(double) latitude longitude:(double) longitude
Initializes a NMAGeoCoordinates instance with specified latitude and longitude values and zero altitude.
Parameters:
•
latitude
An initial latitude value. Values outside of [-90, 90] will be clamped to that range (100 becomes
90).
•
longitude
An initial longitude value. Values outside of [-180, 180] will be wrapped to that range (200 becomes -160).
Returns:
The NMAGeoCoordinates instance, or nil if initialization failed
-(id) initWithLatitude:(double) latitude longitude:(double) longitude
altitude:(float) altitude
Initializes a NMAGeoCoordinates instance with specified values for the initial latitude, longitude and altitude.
Parameters:
•
latitude
An initial latitude value
•
longitude
An initial longitude value
•
altitude
An initial altitude value
Returns:
87
HERE iOS SDK Developer's Guide
► API reference
The NMAGeoCoordinates instance, or nil if initialization failed
-(BOOL) isEqualToGeoCoordinates:(
Determines whether this
is equal to another.
Returns:
YES if the coordinates are equal, NO otherwise
Class Method Details
+(instancetype) geoCoordinatesWithLatitude:(double) latitude longitude:
(double) longitude
Constructs a
with the specified latitude and longitude.
Parameters:
•
latitude
An initial latitude value
•
longitude
An initial longitude value
+(instancetype) geoCoordinatesWithLatitude:(double) latitude longitude:
(double) longitude altitude:(double) altitude
Constructs a
with the specified latitude, longitude, and altitude.
Parameters:
•
latitude
An initial latitude value
•
longitude
An initial longitude value
•
altitude
An initial altitude value
88
HERE iOS SDK Developer's Guide
► API reference
89
NMAGeoPosition
Class Summary
class
NMAGeoPosition
Derived from: NSObject
Represents position, speed, and course information as provided by a positioning source for a distinct moment in time.
Include:
NMAKit.framework/headers/NMAGeoPosition.h
Inheritance Diagrams
Figure 25: Public inheritance diagram for NMAGeoPosition
[For complete information, see the section
]
Public Property Summary
Table 11: Public Property
Public Property
[readable, assign]
The accuracy of the altitude, in meters
[readable, assign]
The geographical location of the position
[readable, assign]
The course (direction of travel) of the position, in degrees.
[readable, assign]
Indicates the validity of the NMAGeoPosition
[readable, assign]
The accuracy of the latitude coordinate, in meters
HERE iOS SDK Developer's Guide
► API reference
90
Public Property
[readable, assign]
The accuracy of the longitude coordinate, in meters
[readable, assign]
The movement speed of the position
[readable, strong]
The time at which the position measurements were taken
Class Method Summary
Table 12: Class Method
Class Methods
A convenience constructor for creating NMAGeoPosition instances with the specified CLLocation
*) coordinates speed:(double) speed
course:(double) course accuracy:(double) accuracy
A convenience constructor for creating NMAGeoPosition instances with specified coordinates, speed, course, and accuracy
*) coordinates speed:(double) speed
course:(double) course accuracy:(double) accuracy timestamp:(NSDate *) timestamp
A convenience constructor for creating NMAGeoPosition instances with specified coordinates, speed, course, and accuracy
*) coordinates speed:(double) speed
course:(double) course latitudeAccuracy:(double) latitudeAccuracy longitudeAccuracy:(double) longitudeAccuracy altitudeAccuracy:(double) altitudeAccuracy timestamp:(NSDate *) timestamp
A convenience constructor for creating NMAGeoPosition instances with specified coordinates, speed, course, latitudeAccuracy, longitudeAccuracy and altitudeAccuracy
Class Details
Represents position, speed, and course information as provided by a positioning source for a distinct moment in time.
Public Property Details
[readable, assign] double altitudeAccuracy
The accuracy of the altitude, in meters.
HERE iOS SDK Developer's Guide
► API reference
91
Note:
Will be NMAGeoPositionUnknownValue if unknown.
[readable, assign]
* coordinates
The geographical location of the position.
[readable, assign] double course
The course (direction of travel) of the position, in degrees.
Valid course values are in the range [0, 360), with 0 degrees representing north and values increasing clockwise. Thus, east is 90 degrees, south is 180 degrees, and so on.
Note:
Will be NMAGeoPositionUnknownValue if unknown.
[readable, assign]
BOOL isValid
Indicates the validity of the NMAGeoPosition. The position is valid if its coordinates are valid.
[readable, assign] double latitudeAccuracy
The accuracy of the latitude coordinate, in meters.
Note:
Will be NMAGeoPositionUnknownValue if unknown.
[readable, assign] double longitudeAccuracy
The accuracy of the longitude coordinate, in meters.
Note:
Will be NMAGeoPositionUnknownValue if unknown.
[readable, assign] double speed
The movement speed of the position.
HERE iOS SDK Developer's Guide
► API reference
92
Note:
Will be NMAGeoPositionUnknownValue if unknown.
[readable, strong]
NSDate * timestamp
The time at which the position measurements were taken.
Class Method Details
+(id) geoPositionWithCLLocation:(CLLocation *) location
A convenience constructor for creating
instances with the specified CLLocation.
+(id) geoPositionWithCoordinates:(
(double) speed course:(double) course accuracy:(double) accuracy
A convenience constructor for creating
instances with specified coordinates, speed, course, and accuracy.
Note:
The accuracy parameter will be used for all of latitudeAccuracy, longitudeAccuracy, and altitudeAccuracy. The timestamp will be set to the current time.
+(id) geoPositionWithCoordinates:(
(double) speed course:(double) course accuracy:(double) accuracy timestamp:
(NSDate *) timestamp
A convenience constructor for creating
instances with specified coordinates, speed, course, and accuracy.
Note:
The accuracy parameter will be used for all of latitudeAccuracy, longitudeAccuracy, and altitudeAccuracy.
+(id) geoPositionWithCoordinates:(
speed:(double) speed course:(double) course latitudeAccuracy:
HERE iOS SDK Developer's Guide
► API reference
93
(double) latitudeAccuracy longitudeAccuracy:(double) longitudeAccuracy altitudeAccuracy:(double) altitudeAccuracy timestamp:(NSDate *) timestamp
A convenience constructor for creating
instances with specified coordinates, speed, course, latitudeAccuracy, longitudeAccuracy and altitudeAccuracy.
NMAPositioningManager
Class Summary
class
NMAPositioningManager
Derived from: NSObject
Manages positioning services for the NMA SDK.
Include:
NMAKit.framework/headers/NMAPositioningManager.h
Inheritance Diagrams
Figure 26: Public inheritance diagram for NMAPositioningManager
[For complete information, see the section
]
Public Property Summary
Table 13: Public Property
Public Property
[readable, assign]
Indicates whether the NMAPositioningManager is currently broadcasting position updates
[readable, assign]
The best estimate for the user's current position.
[readable, assign]
The latest unprocessed position
HERE iOS SDK Developer's Guide
► API reference
94
Instance Method Summary
Table 14: Instance Method
Instance Methods
-(BOOL)
Enables position broadcasting.
-(void)
Disables position broadcasting.
Class Method Summary
Table 15: Class Method
Class Methods
+(
Returns the NMAPositioningManager singleton instance
Class Details
Manages positioning services for the NMA SDK.
This is a singleton class and thus should never be retained, released, or instantiated. The singleton instance is accessed via the sharedPositioningManager method.
Use the startPositioning method to begin tracking position, and stopPositioning to stop. By default, position data comes from CLLocationManager.
Only one type of position is available from the positioning manager in Starter Edition: the raw position. The raw position is simply passed straight through from the positioning manager's data source. If the position is lost, a NMAPositioningManagerDidLosePositionNotification is sent.
Note:
Certain other SDK features may require the use of the positioning manager; if these features are accessed, the positioning manager will be enabled automatically (for example, the
requires valid
authentication credentials to be set via
. If valid credentials are not
present the API may not function correctly or may stop functioning correctly in the future when server side configurations change.
HERE iOS SDK Developer's Guide
► API reference
95
Public Property Details
[readable, assign]
BOOL active
is currently broadcasting position updates.
[readable, assign]
* currentPosition
The best estimate for the user's current position.
The currentPosition will be equal to the rawPosition in the Starter Edition.
Note:
Will be nil if the positioning manager is not active or does not have a valid position.
[readable, assign]
* rawPosition
The latest unprocessed position.
Note:
Will be nil if the latest update did not return a valid position.
Instance Method Details
-(BOOL) startPositioning
Enables position broadcasting.
Returns:
YES if positioning was successfully started, NO if positioning was already in progress or if positioning failed to start.
-(void) stopPositioning
Disables position broadcasting.
Class Method Details
+(
HERE iOS SDK Developer's Guide
► API reference
singleton instance.
Note:
Use this method to obtain a
instance. Do not call init directly.
Returns:
instance
NMARoadElement
Class Summary
class
NMARoadElement
Derived from: NSObject
Represents a section of a road.
Include:
NMAKit.framework/headers/NMARoadElement.h
Inheritance Diagrams
Figure 27: Public inheritance diagram for NMARoadElement
96
[For complete information, see the section
]
Public Property Summary
Table 16: Public Property
Public Property
[readable, weak]
The abbreviated name of the road element
[readable, assign]
The attributes of the NMARoadElement
[readable, assign]
HERE iOS SDK Developer's Guide
► API reference
97
Public Property
The average speed of traffic on the NMARoadElement in m/s, or 0 if the information is not available
[readable, assign]
The number of lanes of the road element, or 0 if the data is unavailable
[readable, assign]
The plural type of the road element
[readable, weak]
The name of the road element, or an empty string if the data is not available
[readable, assign]
The speed limit of the NMARoadElement in m/s, or 0 if the information is not available
[readable, assign]
The type of the road element
[readable, weak]
The unique identifier of the NMARoadElement
Class Details
Represents a section of a road.
Public Property Details
[readable, weak]
NSString * abbreviatedName
The abbreviated name of the road element. For example, I5 for the Interstate 5 in the US. This property will contain an empty string if the abbreviated name is unavailable.
[readable, assign]
NSUInteger attributes
The attributes of the
. Can be a combination of any values from
NMARoadElementAttribute
.
[readable, assign]
NSUInteger averageSpeed
The average speed of traffic on the
in m/s, or 0 if the information is not available.
HERE iOS SDK Developer's Guide
► API reference
[readable, assign]
NSUInteger numberOfLanes
The number of lanes of the road element, or 0 if the data is unavailable.
[readable, assign]
pluralType
See also:
[readable, weak]
NSString * roadName
The name of the road element, or an empty string if the data is not available.
[readable, assign]
NSUInteger speedLimit
The speed limit of the
in m/s, or 0 if the information is not available.
[readable, assign]
type
See also:
[readable, weak]
NSString * uniqueId
The unique identifier of the
.
Compare uniqueIds of two road elements if you only want to know whether they are the same road elements with the same geometries.
98
NMA Mapping
Group Summary
group
NMA Mapping
HERE iOS SDK Developer's Guide
► API reference
The Mapping group provides classes, protocols, and enumerations that can be used to enable an interactive map and related functionality, such as creating and adding map objects.
[For complete information, see the section
]
Nested Classes
Table 17: Public Nested Classes
Public Nested Classes
Public Enumeration Summary
Table 18: Public Enumeration
Public Enumeration
Defines types of animations that can illustrate on-screen map movements.
The types of gesture that can be performed on an NMAMapView.
99
HERE iOS SDK Developer's Guide
► API reference
Public Enumeration
Defines types of NMAMapObject objects that an application can add to a map.
Defines PPI of the map tiles.
Public Variable Summary
Table 19: Public Variable
Public Variable
FOUNDATION_EXPORT NSString *const
Satellite tile scheme presented in "day" colors, with roads
FOUNDATION_EXPORT NSString *const
Normal scheme presented in "day" colors
FOUNDATION_EXPORT NSString *const
Normal scheme presented in "night" colors
FOUNDATION_EXPORT NSString *const
Pedestrian navigation scheme presented in "day" colors
FOUNDATION_EXPORT NSString *const
Pedestrian navigation scheme presented in "night" colors
FOUNDATION_EXPORT NSString *const
Normal scheme presented in "day" with less color palette
FOUNDATION_EXPORT NSString *const
Normal scheme presented in "night" with less color palette
FOUNDATION_EXPORT NSString *const
Satellite tile scheme presented in "day" colors
FOUNDATION_EXPORT NSString *const
Terrain bitmap scheme presented in "day" colors
This value may be passed into the map move method setGeoCenter:zoomLevel:withAnimation: (NMAMapView) in place of zoom in order to preserve the current value of that property
100
HERE iOS SDK Developer's Guide
► API reference
101
Group Details
The Mapping group provides classes, protocols, and enumerations that can be used to enable an interactive map and related functionality, such as creating and adding map objects. Some key classes
and protocols in this group are:
,
, and
Public Enumeration Details
NMAMapAnimation
Include:
NMAKit.framework/headers/NMAMapView.h
Defines types of animations that can illustrate on-screen map movements.
Enumeration Members:
•
NMAMapAnimationLinear
Animation moves in a linear manner as the map resets to a new position.
•
NMAMapAnimationNone
No animation is performed as the map resets to a new position.
NMAMapGestureType
Include:
NMAKit.framework/headers/NMAMapGesture.h
The types of gesture that can be performed on an
Enumeration Members:
•
NMAMapGestureTypeDoubleTap
A double tap.
•
NMAMapGestureTypeLongPress
A long press.
•
NMAMapGestureTypePan
A pan.
•
NMAMapGestureTypePinch
A pinch.
•
NMAMapGestureTypeTap
A tap.
•
NMAMapGestureTypeTwoFingerTap
HERE iOS SDK Developer's Guide
► API reference
A two-finger tap.
•
NMAMapGestureTypeAll
All geture types.
NMAMapObjectType
Include:
NMAKit.framework/headers/NMAMapObject.h
Defines types of
objects that an application can add to a map.
Enumeration Members:
•
NMAMapObjectTypeMarker
A map marker.
•
NMAMapObjectTypePolygon
A polygon.
•
NMAMapObjectTypePolyline
A polyline.
•
NMAMapObjectTypeRoute
A route.
•
NMAMapObjectTypeContainer
A map container to hold other map objects.
•
NMAMapObjectTypeCircle
A circle.
•
NMAMapObjectTypeReserved
A reserved object.
•
NMAMapObjectTypeUnknown
An unknown object.
NMAMapPPI
Include:
NMAKit.framework/headers/NMAMapView.h
Defines PPI of the map tiles.
Enumeration Members:
•
NMAMapPPILow
102
HERE iOS SDK Developer's Guide
► API reference
Default PPI, suitable for mobile devices.
•
NMAMapPPIHigh
High PPI.
•
NMAMapPPIReserved
Internal use only.
Public Variable Details
FOUNDATION_EXPORT NSString *const NMAMapSchemeHybridDay
Include:
NMAKit.framework/headers/NMAMapScheme.h
Satellite tile scheme presented in "day" colors, with roads.
FOUNDATION_EXPORT NSString *const NMAMapSchemeNormalDay
Include:
NMAKit.framework/headers/NMAMapScheme.h
Normal scheme presented in "day" colors.
FOUNDATION_EXPORT NSString *const NMAMapSchemeNormalNight
Include:
NMAKit.framework/headers/NMAMapScheme.h
Normal scheme presented in "night" colors.
FOUNDATION_EXPORT NSString *const NMAMapSchemePedestrianDay
Include:
NMAKit.framework/headers/NMAMapScheme.h
Pedestrian navigation scheme presented in "day" colors.
Note:
When using this scheme it is recommended to enable pedestrian features on the map view.
FOUNDATION_EXPORT NSString *const NMAMapSchemePedestrianNight
Include:
NMAKit.framework/headers/NMAMapScheme.h
103
HERE iOS SDK Developer's Guide
► API reference
Pedestrian navigation scheme presented in "night" colors.
Note:
When using this scheme it is recommended to enable pedestrian features on the map view.
FOUNDATION_EXPORT NSString *const NMAMapSchemeReducedDay
Include:
NMAKit.framework/headers/NMAMapScheme.h
Normal scheme presented in "day" with less color palette.
FOUNDATION_EXPORT NSString *const NMAMapSchemeReducedNight
Include:
NMAKit.framework/headers/NMAMapScheme.h
Normal scheme presented in "night" with less color palette.
FOUNDATION_EXPORT NSString *const NMAMapSchemeSatelliteDay
Include:
NMAKit.framework/headers/NMAMapScheme.h
Satellite tile scheme presented in "day" colors.
Note:
No roads are shown. For satellite and roads use
FOUNDATION_EXPORT NSString *const NMAMapSchemeTerrainDay
Include:
NMAKit.framework/headers/NMAMapScheme.h
Terrain bitmap scheme presented in "day" colors.
FOUNDATION_EXPORT const float NMAMapViewPreserveValue
Include:
NMAKit.framework/headers/NMAMapView.h
This value may be passed into the map move method
setGeoCenter:zoomLevel:withAnimation:
in place of zoom in order to preserve the current value of that property.
See also:
setGeoCenter:zoomLevel:withAnimation:
104
HERE iOS SDK Developer's Guide
► API reference
NMAMapCircle
Class Summary
class
NMAMapCircle
Represents a NMAMapObject in the shape of a circle.
Include:
NMAKit.framework/headers/NMAMapCircle.h
Inheritance Diagrams
Figure 28: Public inheritance diagram for NMAMapCircle
[For complete information, see the section
]
Public Property Summary
Table 20: Public Property
Public Property
[readable, writable, strong]
The NMAGeoCoordinates representing the center of the NMAMapCircle
[readable, writable, strong]
UIColor *
The fill color for the NMAMapCircle
[readable, writable, strong]
UIColor *
The line color for the NMAMapCircle
[readable, writable, assign]
The line width, in pixels, for the NMAMapCircle border
[readable, writable, assign] double
105
HERE iOS SDK Developer's Guide
► API reference
106
Public Property
The radius of the NMAMapCircle, in meters
Instance Method Summary
Table 21: Instance Method
Instance Methods
Initializes a NMAMapCircle instance with the specified NMAGeoCoordinates as the center and a radius of 1 meter
*) coordinates radius:(double)
radius
Initializes a NMAMapCircle instance with the specified NMAGeoCoordinates as the center and the specified double as the radius (in meters)
Class Method Summary
Table 22: Class Method
Class Methods
A convenience method to construct a NMAMapCircle at specified coordinates
(double) radius
A convenience method to construct a NMAMapCircle at specified coordinates and with a given radius
Class Details
Represents a
in the shape of a circle. NMAMapCircle is helper class for creating and updating a
representing a circle.
Public Property Details
[readable, writable, strong]
The NMAGeoCoordinates representing the center of the NMAMapCircle.
Note:
The NMAViewObject location property will return the same coordinates.
HERE iOS SDK Developer's Guide
► API reference
107
[readable, writable, strong]
UIColor * fillColor
The fill color for the NMAMapCircle.
Note:
The default value (in RGBA) is 0x00498A55
[readable, writable, strong]
UIColor * lineColor
The line color for the NMAMapCircle.
Note:
The default value (in RGBA) is 0xC00066FF.
[readable, writable, assign]
NSUInteger lineWidth
The line width, in pixels, for the NMAMapCircle border. The supported value range is [0..100].
Note:
The default value is 0 pixels
[readable, writable, assign] double radius
The radius of the NMAMapCircle, in meters.
Note:
The default value is 1 meter
Instance Method Details
-(instancetype) initWithGeoCoordinates:(
Initializes a NMAMapCircle instance with the specified NMAGeoCoordinates as the center and a radius of 1 meter.
Parameters:
•
coordinates
A NMAGeoCoordinates representing the NMAMapCircle center
HERE iOS SDK Developer's Guide
► API reference
108
Returns:
The NMAMapCircle
-(instancetype) initWithGeoCoordinates:(
radius:(double) radius
Initializes a NMAMapCircle instance with the specified NMAGeoCoordinates as the center and the specified double
as the radius (in meters).
Parameters:
•
coordinates
A NMAGeoCoordinates representing the NMAMapCircle center
•
radius
The radius of the circle
Returns:
The NMAMapCircle
Class Method Details
+(instancetype) mapCircleWithGeoCoordinates:(
coordinates
A convenience method to construct a
Parameters:
•
coordinates
The location of the map circle center
+(instancetype) mapCircleWithGeoCoordinates:(
coordinates radius:(double) radius
A convenience method to construct a
at specified coordinates and with a given radius.
Parameters:
•
coordinates
The location of the map circle center
HERE iOS SDK Developer's Guide
► API reference
•
radius
The radius (in meters) of the map circle
NMAMapContainer
Class Summary
class
NMAMapContainer
instances, containers can be added to a
instance.
Include:
NMAKit.framework/headers/NMAMapContainer.h
Inheritance Diagrams
Figure 29: Public inheritance diagram for NMAMapContainer
109
[For complete information, see the section
]
Public Property Summary
Table 23: Public Property
Public Property
[readable, weak]
The NSArray of NMAMapObject objects within the NMAMapContainer
Instance Method Summary
Table 24: Instance Method
Instance Methods
-(BOOL)
(
*) aMapObject
HERE iOS SDK Developer's Guide
► API reference
110
Instance Methods
Adds a NMAMapObject to the NMAMapContainer.
-(BOOL)
Removes all NMAMapObject objects from the NMAMapContainer
-(BOOL)
Removes the specified NMAMapObject from the NMAMapContainer
Class Details
instances, containers can be added to a
instance.
Applications can, as necessary, add or remove certain types of NMAMapObject objects to or from a NMAMapContainer (refer to
for details). A NMAMapContainer is also useful for
grouping together NMAMapObject objects to allow application operations on entire groups of map objects without requiring an iterative approach to inspecting or changing the state of each individual
NMAMapObject (e.g. for changing their visibility).
Note:
instance in a container is relative only to other
instances within the same container. Note that containers are derived from
also have zOrder.
Public Property Details
[readable, weak]
NSArray * mapObjects
The NSArray of
objects within the NMAMapContainer.
Instance Method Details
-(BOOL) addMapObject:(
Adds a NMAMapObject to the NMAMapContainer.
NMAMapObject types that can be added to a NMAMapContainer include:
•
•
•
•
HERE iOS SDK Developer's Guide
► API reference
• nested
objects
Note:
Attempts to add an object twice to the same container will be ignored.
Parameters:
•
aMapObject
A NMAMapObject to be added to the NMAMapContainer.
Returns:
YES if the NMAMapObject was added successfully, NO otherwise.
See also:
-(BOOL) removeAllMapObjects
Removes all
objects from the NMAMapContainer.
Returns:
YES if all NMAMapObject objects were removed successfully, NO otherwise.
-(BOOL) removeMapObject:(
Removes the specified NMAMapObject from the NMAMapContainer.
Note:
If the specified NMAMapObject is not contained within the NMAMapContainer, the container will be unchanged.
Parameters:
•
aMapObject
A NMAMapObject to remove from the NMAMapContainer.
Returns:
YES if the NMAMapObject was removed successfully, NO otherwise.
See also:
111
HERE iOS SDK Developer's Guide
► API reference
<NMAMapGestureDelegate>
Protocol Summary
protocol
<NMAMapGestureDelegate>
Derived from: <NSObject>
Delegate protocol for map gesture handling.
Include:
NMAKit.framework/headers/NMAMapGesture.h
Inheritance Diagrams
Figure 30: Public inheritance diagram for <NMAMapGestureDelegate> – <NMAMapGestureDelegate>
112
[For complete information, see the section
Instance Method Summary
Table 25: Instance Method
Instance Methods
*) mapView didReceiveDoubleTapAtLocation:(CGPoint) location
Delegate callback for an NMAMapView double-tap gesture
*) mapView didReceiveLongPressAtLocation:(CGPoint) location
Delegate callback for an NMAMapView long press gesture
*) mapView didReceivePan:(CGPoint) translation atLocation:(CGPoint) location
Delegate callback for an
*) mapView didReceivePinch:(float) pinch atLocation:
(CGPoint) location
Delegate callback for an
HERE iOS SDK Developer's Guide
► API reference
113
Instance Methods
*) mapView didReceiveTapAtLocation:(CGPoint) location
Delegate callback for an NMAMapView tap gesture
*) mapView didReceiveTwoFingerTapAtLocation:
(CGPoint) location
Delegate callback for an NMAMapView two finger-tap gesture
Protocol Details
Delegate protocol for map gesture handling.
This protocol should be implemented by any class which acts as the gesture delegate for a map view or any map subview which needs to receive gestures from the map view.
The
may optionally be provided with a gesture delegate, set via the gestureDelegate
property. This delegate can be used to receive events about gestures.
Note:
Methods of this protocol will be called on the main queue.
Instance Method Details
- @optional (void) mapView:(
didReceiveDoubleTapAtLocation:(CGPoint) location
Delegate callback for an
Parameters:
•
mapView
on which the gesture occurred.
•
location
The screen location in points at which the gesture occurred.
- @optional (void) mapView:(
didReceiveLongPressAtLocation:(CGPoint) location
Delegate callback for an
Parameters:
HERE iOS SDK Developer's Guide
► API reference
114
•
mapView
on which the gesture occurred.
•
location
The screen location in points at which the gesture occurred.
- @optional (void) mapView:(
*) mapView didReceivePan:(CGPoint)
translation atLocation:(CGPoint) location
Delegate callback for an
The translation of a pan gesture is reported as the distance covered by the gesture since the last callback or since the beginning of the gesture. Note that this differs from the behaviour of
UIPanGestureRecognizer, which reports the total translation since the beginning of the gesture.
Parameters:
•
mapView
on which the gesture occurred.
•
translation
The current translation of the pan gesture, in points.
•
location
The screen location in points at which the gesture occurred.
- @optional (void) mapView:(
*) mapView didReceivePinch:(float)
pinch atLocation:(CGPoint) location
Delegate callback for an
The current pinch change is measured as the relative distance change of the two touch points since the last pinch callback or the beginning of the gesture. For example, if the pinch value is 1.2, the two touches are 20% farther apart than they were at the time of the last update. Note that this differs from the behaviour of UIPinchGestureRecognizer, which reports the total pinch since the beginning of the gesture.
Parameters:
•
mapView
on which the gesture occurred.
•
pinch
The current relative pinch change of the gesture.
HERE iOS SDK Developer's Guide
► API reference
115
•
location
The screen location in points at which the gesture occurred.
- @optional (void) mapView:(
*) mapView didReceiveTapAtLocation:
(CGPoint) location
Delegate callback for an
Parameters:
•
mapView
on which the gesture occurred.
•
location
The screen location in points at which the gesture occurred.
- @optional (void) mapView:(
didReceiveTwoFingerTapAtLocation:(CGPoint) location
Delegate callback for an
Parameters:
•
mapView
on which the gesture occurred.
•
location
The screen location in points at which the gesture occurred.
NMAMapMarker
Class Summary
class
NMAMapMarker
Represents a marker used to display an icon on a geographical position on a map.
Include:
NMAKit.framework/headers/NMAMapMarker.h
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 31: Public inheritance diagram for NMAMapMarker
116
[For complete information, see the section
]
Public Property Summary
Table 26: Public Property
Public Property
[readable, writable, assign]
CGPoint
The CGPoint offest of the NMAMapMarker from its anchored location.
[readable, writable, strong]
The geographical coordinates at which the NMAMapMarker is displayed on a map
[readable, writable, strong]
UIImage *
The UIImage displayed at the marker location
Instance Method Summary
Table 27: Instance Method
Instance Methods
Initializes a NMAMapMarker instance with the specified NMAGeoCoordinates
*) coordinates image:(UIImage *)
image
Initializes a NMAMapMarker instance with the specified NMAGeoCoordinates and UIImage for the displayed icon
setAnchorOffsetUsingLayoutPosition:
(
) position
HERE iOS SDK Developer's Guide
► API reference
117
Class Method Summary
Table 28: Class Method
Class Methods
A convenience method to construct an NMAMapMarker at the specified coordinates
(UIImage *) image
A convenience method to construct an NMAMapMarker at the specified coordinates and with a UIImage icon
Class Details
Represents a marker used to display an icon on a geographical position on a map. The map handles proper placement of icons on the screen as well as panning.
Note:
Application users can select NMAMapMarker objects.
Public Property Details
[readable, writable, assign]
CGPoint anchorOffset
The CGPoint offest of the NMAMapMarker from its anchored location.
Use this property to reposition a NMAMapMarker as needed. The x and y offset values are measured in points. Positive offset values move the NMAMapMarker down and to the right, while negative values move it up and to the left.
If no offset is provided, the NMAMapMarker is centered on its anchor; that is, the center of the marker image is located at the map-space representation of the marker's world-space location (its anchor, an NMAGeoCoordinates).
[readable, writable, strong]
The geographical coordinates at which the NMAMapMarker is displayed on a map.
[readable, writable, strong]
UIImage * icon
The UIImage displayed at the marker location.
HERE iOS SDK Developer's Guide
► API reference
118
Instance Method Details
-(instancetype) initWithGeoCoordinates:(
Initializes a NMAMapMarker instance with the specified NMAGeoCoordinates.
Parameters:
•
coordinates
A NMAGeoCoordinates representing the map coordinates for displaying the NMAMapMarker
Returns:
The NMAMapMarker
-(instancetype) initWithGeoCoordinates:(
image:(UIImage *) image
Initializes a NMAMapMarker instance with the specified NMAGeoCoordinates and UIImage for the displayed icon.
Parameters:
•
coordinates
A NMAGeoCoordinates representing the map coordinates for displaying the NMAMapMarker
•
image
A UIImage the icon.
Returns:
The NMAMapMarker
-(CGPoint) setAnchorOffsetUsingLayoutPosition:(
A convenience function to set where the NMAMapMarker is attached to its anchor
Parameters:
•
position
A NMAnchorLocation for anchoring the marker icon.
Returns:
HERE iOS SDK Developer's Guide
► API reference
The CGPoint offset value that was applied to the anchorOffset property
Class Method Details
+(id) mapMarkerWithGeoCoordinates:(
A convenience method to construct an
Parameters:
•
coordinates
at which to create the map marker.
+(instancetype) mapMarkerWithGeoCoordinates:(
coordinates image:(UIImage *) image
A convenience method to construct an
at the specified coordinates and with a
UIImage icon.
Parameters:
•
coordinates
at which to create the map marker.
•
image
The UIImage to use for the marker icon.
NMAMapObject
Class Summary
class
NMAMapObject
Derived from: NSObject
Include:
NMAKit.framework/headers/NMAMapObject.h
119
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 32: Public inheritance diagram for NMAMapObject
120
[For complete information, see the section
]
Public Property Summary
Table 29: Public Property
Public Property
[readable, weak]
*
The map object's container
[readable, assign]
The map object's type
[readable, writable, assign]
Indicates whether the NMAMapObject is visible
[readable, writable, assign]
The NSUInteger z-index (stacking order) for the
if the object was added to
Instance Method Summary
Table 30: Instance Method
Instance Methods
-(BOOL)
(float) zoomLevel
Determines whether the map object is set to visible at the specified zoom level when the map object's visible property is set to YES
-(void)
(BOOL) visible atZoomLevel:(float) zoomLevel
Sets the visibility of the map object at a specific zoom level.
HERE iOS SDK Developer's Guide
► API reference
121
Instance Methods
-(void)
(BOOL) visible fromZoomLevel:(float) fromZoomLevel toZoomLevel:(float)
toZoomLevel
Sets the visibility of the map object for a range of zoom levels.
Returns the unique ID value of the NMAMapObject
Class Details
Public Property Details
[readable, weak]
The map object's container. This will be nil if the map object does not belong to a container or was
directly.
[readable, assign]
type
The map object's type.
[readable, writable, assign]
BOOL visible
Indicates whether the NMAMapObject is visible.
Note:
The getter is isVisible
. If set to visibile, by default, it's visible at all zoom levels.
To customize the visibility of the map object for certain zoom levels, please refer to setVisibility:atZoomLevel
and/or setVisibility:fromZoomLevel:toZoomLevel
[readable, writable, assign]
NSUInteger zIndex
The NSUInteger z-index (stacking order) for the
within its containing
directly.
Must be in the range NMAMapObjectMinimumZIndex..NMAMapObjectMaximumZIndex. The property will be clamped to this range if invalid values are specified.
Note:
HERE iOS SDK Developer's Guide
► API reference
122
Objects with the highest value are placed at the top of the stacking order.
Instance Method Details
-(BOOL) isVisibleAtZoomLevel:(float) zoomLevel
Determines whether the map object is set to visible at the specified zoom level when the map object's visible property is set to YES.
Parameters:
•
zoomLevel
for checking whether the map object is visible. Will be clamped to the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel. This is rounded off to the nearest integer. e.g. 14.1 means [14..15)
-(void) setVisibility:(BOOL) visible atZoomLevel:(float) zoomLevel
Sets the visibility of the map object at a specific zoom level.
By default, the map object is visible at all zoom levels. Each zoom level retains its own visibility state.
Note:
This will take effect if/when the map object's visibile property is set YES.
Parameters:
•
visible
indicates whether the map object should be visible.
•
zoomLevel
for applying the specified visibility. Will be clamped to the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel. This is rounded off to the nearest integer. e.g. 14.1 means [14..15)
-(void) setVisibility:(BOOL) visible fromZoomLevel:(float) fromZoomLevel
toZoomLevel:(float) toZoomLevel
Sets the visibility of the map object for a range of zoom levels.
HERE iOS SDK Developer's Guide
► API reference
123
By default, the map object is visible at all zoom levels. Each zoom level retains its own visibility state.
If you make the following calls:
#1. visible property is set to YES|111111111111111111111|
#2. setVisible:NO fromZoomLevel:10 toZoomLevel:16 10 16
|0000000|#3. setVisible:YES fromZoomLevel:5 toZoomLevel:13 5 13
|111111111|
#4. setVisible:NO atZoomLevel:20The result will be that this map object will be invisible at zoom levels 14-16 and 20 and visible at the others. 5 14 17 20
|111111111111110001110|
Note:
This will take effect if/when the map object's visibile property is set YES.
Parameters:
•
visible
indicates whether the map object should be visible.
•
fromZoomLevel
clamped to range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel, rounded off to the nearest integer.
•
toZoomLevel
clamped to range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel, rounded off to the nearest integer.
-(NSUInteger) uniqueId
Returns the unique ID value of the NMAMapObject.
Note:
This value will be consistent for the lifetime of the object.
Returns:
The unique ID
NMAMapPolygon
Class Summary
class
NMAMapPolygon
Represents a NMAMapObject in the shape of a polygon.
HERE iOS SDK Developer's Guide
► API reference
Include:
NMAKit.framework/headers/NMAMapPolygon.h
Inheritance Diagrams
Figure 33: Public inheritance diagram for NMAMapPolygon
[For complete information, see the section
]
Public Property Summary
Table 31: Public Property
Public Property
[readable, writable, strong]
UIColor *
The fill color for the NMAMapPolygon
[readable, writable, strong]
UIColor *
The color for the NMAMapPolygon border line
[readable, writable, assign]
The line width, in pixels, for the NMAMapPolygon border
[readable, weak]
The NSArray of NMAGeoCoordinates objects comprising the path that defines the NMAMapPolygon shape
Instance Method Summary
Table 32: Instance Method
Instance Methods
-(void)
*) vertex atIndex:(NSUInteger) index
Insert a NMAGeoCoordinates point at the specified index of the NMAMapPolygon path
-(void)
(
*) vertex
Append a NMAGeoCoordinates path point to the end of the NMAMapPolygon
124
HERE iOS SDK Developer's Guide
► API reference
Instance Methods
-(void)
Removes all vertices from the NMAMapPolygon's path
-(BOOL)
(
*) coordinates
Determines if the NMAMapPolygon contains the input NMAGeoCoordinates
Initializes a NMAMapPolygon instance with the specified NSArray of NMAGeoCoordinates objects
-(BOOL)
Determines whether the NMAMapPolygon object is valid
-(void)
-(void)
Remove a NMAGeoCoordinates point at the specified index of the NMAMapPolygon path
Class Method Summary
Table 33: Class Method
Class Methods
(NSArray *) vertices
A convenience method for constructing an NMAMapPolygon
Class Details
Represents a
in the shape of a polygon. In comparison to a
assumed that the last coordinates within the path is connected with the first coordinates, thereby constructing an enclosed geometry.
Note:
The NMAViewObject location property for an
returns the coordinates of the
first vertex (if available).
Public Property Details
[readable, writable, strong]
UIColor * fillColor
The fill color for the NMAMapPolygon.
125
HERE iOS SDK Developer's Guide
► API reference
126
[readable, writable, strong]
UIColor * lineColor
The color for the NMAMapPolygon border line.
Note:
Attempts to set this property to nil are ignored.
[readable, writable, assign]
NSUInteger lineWidth
The line width, in pixels, for the NMAMapPolygon border.
The line width must be in the range [0, 100]. The default width is 1 pixel.
[readable, weak]
NSArray * vertices
The NSArray of NMAGeoCoordinates objects comprising the path that defines the NMAMapPolygon shape.
Instance Method Details
-(void) addVertex:(
*) vertex atIndex:(NSUInteger) index
Insert a NMAGeoCoordinates point at the specified index of the NMAMapPolygon path.
Note:
If index is equal or greater than the total number of vertices, the vertex will be appended to the end of the polygon path.
Parameters:
•
vertex
A NMAGeoCoordinates path point to add.
•
index
Position to insert. Index starts with 0.
-(void) appendVertex:(
Append a NMAGeoCoordinates path point to the end of the NMAMapPolygon.
Parameters:
HERE iOS SDK Developer's Guide
► API reference
127
•
vertex
A NMAGeoCoordinates path point to append
-(void) clearVertices
Removes all vertices from the
-(BOOL) containsGeoCoordinates:(
Determines if the NMAMapPolygon contains the input NMAGeoCoordinates. Points at the peaks or corners of the polygon are considered outside the polygon.
Parameters:
•
coordinates
NMAGeoCoordinates to test. The altitude is ignored.
Returns:
YES if the NMAGeoCoordinates is inside the NMAMapPolygon, NO otherwise
-(instancetype) initWithVertices:(NSArray *) vertices
Initializes a NMAMapPolygon instance with the specified NSArray of
objects.
Parameters:
•
vertices
A NSArray of NMAGeoCoordinates points defining the NMAMapPolygon shape
Returns:
The NMAMapPolygon
-(BOOL) isValid
Determines whether the NMAMapPolygon object is valid. A polygon is valid as long as it does not selfintersect.
Returns:
YES if the NMAMapPolygon is valid, NO otherwise
HERE iOS SDK Developer's Guide
► API reference
-(void) removeLastVertex
Remove the last NMAGeoCoordinates point of the NMAMapPolygon
-(void) removeVertexAtIndex:(NSUInteger) index
Remove a NMAGeoCoordinates point at the specified index of the NMAMapPolygon path.
Parameters:
•
index
Position to remove. Index starts with 0 and must be smaller than the total number of vertices.
Class Method Details
+(instancetype) mapPolygonWithVertices:(NSArray *) vertices
A convenience method for constructing an
.
Parameters:
•
vertices
An array of
which define the polygon
NMAMapPolyline
Class Summary
class
NMAMapPolyline
Represents a NMAMapObject in the shape of a polyline.
Include:
NMAKit.framework/headers/NMAMapPolyline.h
128
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 34: Public inheritance diagram for NMAMapPolyline
[For complete information, see the section
]
Public Property Summary
Table 34: Public Property
Public Property
[readable, writable, strong]
UIColor *
The color for the NMAMapPolyline
[readable, writable, assign]
The width, in pixels, for the NMAMapPolyline
[readable, assign]
The NSArray of NMAGeoCoordinates that comprise the path of the NMAMapPolyline
Instance Method Summary
Table 35: Instance Method
Instance Methods
-(void)
*) vertex atIndex:(NSUInteger) index
Insert a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path
-(void)
(
*) vertex
Append a NMAGeoCoordinates point to the end of the NMAMapPolyline path
-(void)
Removes all vertices from the NMAMapPolyline's path
-(NSInteger)
indexOfNearestVertexToGeoCoordinates:
(
*) coordinates
129
HERE iOS SDK Developer's Guide
► API reference
Instance Methods
Determines the index of the NMAMapPolyline path array that is closest to the specified NMAGeoCoordinates object
Initializes a NMAMapPolyline instance with the specified NSArray of NMAGeoCoordinates objects
-(
nearestVertexToGeoCoordinates:
Determines the NMAGeoCoordinates along the NMAMapPolyline path that is closest to the specified NMAGeoCoordinates object
-(void)
Remove the last NMAGeoCoordinates point of the NMAMapPolyline path
-(void)
Remove a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path
Class Method Summary
Table 36: Class Method
Class Methods
(NSArray *) vertices
A convenience method for constructing an NMAMapPolyline
Class Details
Represents a
in the shape of a polyline.
A NMAMapPolyline has multiple points that combine to create its path and which are traversed in order. The line between two consecutive points is always straight and is defined by the shortest navigable way to move between them.
Note:
The NMAViewObject location property for an
returns the coordinates of the first vertex (if available).
Public Property Details
[readable, writable, strong]
UIColor * lineColor
The color for the NMAMapPolyline.
Note:
130
HERE iOS SDK Developer's Guide
► API reference
131
Attempts to set this property to nil are ignored.
[readable, writable, assign]
NSUInteger lineWidth
The width, in pixels, for the NMAMapPolyline.
The line width must be in the range [0, 100]. The default width is 1 pixel.
[readable, assign]
NSArray * vertices
The NSArray of
that comprise the path of the NMAMapPolyline.
Instance Method Details
-(void) addVertex:(
*) vertex atIndex:(NSUInteger) index
Insert a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path.
Note:
If index is equal or greater than the total number of vertices, the vertex will be appended to the end of the polyline path.
Parameters:
•
vertex
A NMAGeoCoordinates path point to add.
•
index
Position to insert. Index starts with 0.
-(void) appendVertex:(
Append a NMAGeoCoordinates point to the end of the NMAMapPolyline path.
Parameters:
•
vertex
A NMAGeoCoordinates path point to append
-(void) clearVertices
HERE iOS SDK Developer's Guide
► API reference
132
Removes all vertices from the
-(NSInteger) indexOfNearestVertexToGeoCoordinates:(
coordinates
Determines the index of the NMAMapPolyline path array that is closest to the specified
NMAGeoCoordinates object.
Parameters:
•
coordinates
A NMAGeoCoordinates to test for nearness to the NMAMapPolyline
Returns:
The index of the NMAGeoCoordinates vertex
-(instancetype) initWithVertices:(NSArray *) vertices
Initializes a NMAMapPolyline instance with the specified NSArray of
Parameters:
•
vertices
A NSArray of NMAGeoCoordinates points defining the NMAMapPolyline
Returns:
The NMAMapPolyline
-(
*) nearestVertexToGeoCoordinates:(
coordinates
Determines the NMAGeoCoordinates along the NMAMapPolyline path that is closest to the specified
NMAGeoCoordinates object.
Parameters:
•
coordinates
A NMAGeoCoordinates to test for nearness to the NMAMapPolyline
Returns:
The NMAGeoCoordinates vertex along the NMAMapPolyline path
HERE iOS SDK Developer's Guide
► API reference
-(void) removeLastVertex
Remove the last NMAGeoCoordinates point of the NMAMapPolyline path.
-(void) removeVertexAtIndex:(NSUInteger) index
Remove a NMAGeoCoordinates point at the specified index of the NMAMapPolyline path.
Parameters:
•
index
Position to remove. Index starts with 0 and must be smaller than the total number of vertices.
Class Method Details
+(instancetype) mapPolylineWithVertices:(NSArray *) vertices
A convenience method for constructing an
Parameters:
•
vertices
An array of
which define the polyline
NMAMapRoute
Class Summary
class
NMAMapRoute
Represents a
in the shape of a route that can be displayed on a map.
Include:
NMAKit.framework/headers/NMAMapRoute.h
133
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 35: Public inheritance diagram for NMAMapRoute
[For complete information, see the section
]
See also:
Public Property Summary
Table 37: Public Property
Public Property
[readable, writable, strong]
UIColor *
The UIColor representing the color of the NMAMapRoute
[readable, writable, assign]
Indicates whether the maneuver number is displayed on the NMAMapRoute
[readable, writable, strong]
*
The NMARoute represented by the NMAMapRoute
Instance Method Summary
Table 38: Instance Method
Instance Methods
Use mapRouteWithRoute to instantiate a NMAMapRoute
134
HERE iOS SDK Developer's Guide
► API reference
Class Method Summary
Table 39: Class Method
Class Methods
*) route
A convenience constructor for NMAMapRoute
Class Details
Represents a
in the shape of a route that can be displayed on a map.
In order to display the route object on the map, the route object needs to be added to an
using its addMapObject: method. The NMAViewObject location property for a
returns the coordinates of the first waypoint.
See also:
Public Property Details
[readable, writable, strong]
UIColor * color
The UIColor representing the color of the NMAMapRoute.
Note:
Alpha-value transparency is supported and will also be set when setting this property.
[readable, writable, assign]
BOOL maneuverNumberDisplayed
Indicates whether the maneuver number is displayed on the NMAMapRoute.
[readable, writable, strong]
The
.
Instance Method Details
-(instancetype) UNAVAILABLE_ATTRIBUTE
135
HERE iOS SDK Developer's Guide
► API reference
Use mapRouteWithRoute to instantiate a
.
Class Method Details
+(instancetype) mapRouteWithRoute:(
Parameters:
•
route
The route object from which to construct the
.
NMAMapScheme
Class Summary
class
NMAMapScheme
Derived from: NSObject
Represents a collection of schemes that a NMAMapView supports.
Include:
NMAKit.framework/headers/NMAMapScheme.h
Inheritance Diagrams
Figure 36: Public inheritance diagram for NMAMapScheme
[For complete information, see the section
]
Class Method Summary
Table 40: Class Method
Class Methods
+(BOOL)
(NSString *) scheme
136
HERE iOS SDK Developer's Guide
► API reference
137
Class Methods
Determines whether the specified scheme is supported (is valid for the application)
Class Details
Represents a collection of schemes that a
supports. Each of the schemes in this class can be set by way of the
Class Method Details
+(BOOL) isValid:(NSString *) scheme
Determines whether the specified scheme is supported (is valid for the application).
Parameters:
•
scheme
A NSString representing the scheme to check
Returns:
YES if the scheme is valid, NO otherwise
NMAMapTileLayer
Class Summary
class
NMAMapTileLayer
Derived from: NSObject
A layer of custom raster tiles for display in an
Include:
NMAKit.framework/headers/NMAMapTileLayer.h
Inheritance Diagrams
Figure 37: Public inheritance diagram for NMAMapTileLayer
HERE iOS SDK Developer's Guide
► API reference
[For complete information, see the section
]
Public Property Summary
Table 41: Public Property
Public Property
[readable, writable, assign]
Specifies the
within which tiles will be requested and rendered.
[readable, assign]
Specifies whether tile bitmaps will be cached to disk by the framework.
[readable, assign]
Identifier used to associate disk cached tile data with a
instance to prevent clashes in the cache folder.
[readable, writable, assign]
Specifies the maximum size the cache will consume on disk.
[readable, writable, assign]
Specifies the cache expiration time in seconds.
[readable, writable, weak] id<
[readable, assign]
Indicates if the tile layer is locked
[readable, writable, assign]
Specifies the Z-index (stacking order) for the bitmap tiles within the map layer specified by the mapLayerType property.
Instance Method Summary
Table 42: Instance Method
Instance Methods
-(void)
Clear the file system cache identified by the cacheIdentifier property
-(void)
(int) zoomLevel
Hide the raster tiles at the specified zoom level.
-(void)
(int) fromLevel toZoomLevel:(int) toLevel
Hide the raster tiles at the specified zoom level range.
138
HERE iOS SDK Developer's Guide
► API reference
139
Instance Methods
-(BOOL)
Returns whether tiles are visisble at the specified zoom level.
-(void)
(BOOL) cacheEnabled withIdentifier:(NSString *) cacheIdentifier
/brief Enable/Disable caching of tile data to disk
-(void)
(int) zoomLevel
Show the raster tiles at the specified zoom level.
-(void)
(int) fromLevel toZoomLevel:(int) toLevel
Show the raster tiles at the specified zoom level range.
Class Details
A layer of custom raster tiles for display in an
Raster tiles are supplied as bitmap data and can be supplied synchronously or simply by providing a
URL from which to download the tiles from.
To use this class create an instance, configure the properties and call
NMAMapView::addMapTileLayer.
Note:
IMPORTANT! The properties of this interface should not be modified after the instance has been added to an
property.
Public Property Details
[readable, writable, assign]
* boundingBox
Specifies the
within which tiles will be requested and rendered.
Tiles falling fully outside the boundingBox will not be requested.
This property defaults to an unbounded value - i.e. tiles are rendered across the world.
Note:
This property cannot be set when the instance is locked. See
[readable, assign]
BOOL cacheEnabled
Specifies whether tile bitmaps will be cached to disk by the framework.
HERE iOS SDK Developer's Guide
► API reference
140
File system caching is provided as a convenience. If caching is enabled tiles will not be re-requested via NMAMapTileLayerDelegate until they have expired.
This property defaults to NO. Caching is enabled by calling setCacheEnabled:withIdentifier:.
[readable, assign]
NSString * cacheIdentifier
Identifier used to associate disk cached tile data with a
instance to prevent clashes in the cache folder.
You must use unique cache identifiers to ensure there will be no filename clashes in the cache folder structure. It also allows you to easily identify the cache in the filesystem.
This property is set when you enable caching. See setCacheEnabled:withIdentifier:.
[readable, writable, assign]
NSUInteger cacheSizeLimit
Specifies the maximum size the cache will consume on disk.
The framework may allow the cache size to grow an additional 5MB to the size specified in order to reduce disk access.
This property defaults to 0 which means the cache size is not limited.
Note:
This property has no effect if the cacheEnabled property is set to NO. Also, this property cannot be set when the instance is locked. See
.
[readable, writable, assign]
NSTimeInterval cacheTimeToLive
Specifies the cache expiration time in seconds.
Tile bitmaps will expire cacheTimeToLive seconds after they have been downloaded causing them to be re-requested via
when the map needs to render them.
This property defaults to 0 which means the cached tiles never expire.
Note:
This property has no effect if the cacheEnabled property is set to NO. Negative values will be reset to 0.
[readable, writable, weak]
> dataSource
HERE iOS SDK Developer's Guide
► API reference
141
Data source that provides tile bitmap data for the
Note:
This property cannot be set when the instance is locked. See
[readable, assign]
BOOL locked
Indicates if the tile layer is locked.
The tile layer is locked when it is added to an
instance. While the tile layer is locked attempts to set any properties will be ignored. The tile layer is unlocked when it is removed from an
[readable, writable, assign]
NSUInteger zIndex
Specifies the Z-index (stacking order) for the bitmap tiles within the map layer specified by the mapLayerType property.
All objects within a map layer have a Z-index associated with them. Objects with the highest value are placed at the top of the stacking order. If two or more objects within a map layer have the same zindex value the their stacking order is undefind.
Z-index values range from NMAMapObjectMinimumZIndex to NMAMapObjectMaximumZIndex. The property will be clamped to this range if invalid values are specified.
This property defaults to NMAMapObjectMinimumZIndex.
Note:
This property cannot be set when the instance is locked. See
Instance Method Details
-(void) clearCache
Clear the file system cache identified by the cacheIdentifier property.
Note:
To guarantee the cache is cleared this method should be called after the
instance has been removed from the
HERE iOS SDK Developer's Guide
► API reference
142
-(void) hideAtZoomLevel:(int) zoomLevel
Hide the raster tiles at the specified zoom level.
You can control the tile visibility for each zoom level independently. For example, tiles may be visible at levels 0, 5, 7 only. Tiles are shown at all zoom levels by default.
Note:
This method does nothing when the instance is locked. See
.
Parameters:
•
zoomLevel
Zoom level at which to hide the tiles. Values outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored
-(void) hideFromZoomLevel:(int) fromLevel toZoomLevel:(int) toLevel
Hide the raster tiles at the specified zoom level range.
You can control the tile visibility for each zoom level independently. This method allows you set the visibility for a range of zoom levels in one call. Tiles are shown at all zoom levels by default.
The method will do nothing if ANY parameters fall outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel or if fromLevel > toLevel.
Note:
This method does nothing when the instance is locked. See
.
Parameters:
•
fromLevel
Lower zoom level index at which to hide the tiles. Values outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored
•
toLevel
Upper zoom level index at which to hide the tiles. Values outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored
-(BOOL) isShownAtZoomLevel:(int) zoomLevel
Returns whether tiles are visisble at the specified zoom level.
You can control the tile visibility for each zoom level independently. This method allows you set the visibility for a range of zoom levels in one call. Tiles are shown at all zoom levels by default.
HERE iOS SDK Developer's Guide
► API reference
143
Parameters:
•
zoomLevel
Zoom level. Values outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will return NO.
Returns:
YES if tiles are shown at the specified zoom level, NO otherwise
-(void) setCacheEnabled:(BOOL) cacheEnabled withIdentifier:(NSString *)
cacheIdentifier
/brief Enable/Disable caching of tile data to disk.
File system caching is provided as a convenience. If caching is enabled tiles will not be re-requested via NMAMapTileLayerDelegate until they have expired.
It's important to always use the same cache identifier for your tile data. Otherwise, multiple disassociated cache folders will be created in the file system. This wastes disk space, and you will not benefit from persistent disk caching across sessions.
Note:
Calling this method changes the values of the cacheEnabled and cacheIdentifier properties.
Parameters:
•
cacheEnabled
YES to enable caching, NO to disable.
•
cacheIdentifier
You must use a unique cache identifier to ensure there will be no filename clashes in the cache folder structure. Passing a nil or empty string will result in caching NOT being enabled. The identifier is set the first time you call this method and will not be changed by subsequent calls to this method for the lifetime of the instance. If the identifier you supply contains non alphanumeric characters they will be stripped from the identifier, with the exception of "_" and
"-".
-(void) showAtZoomLevel:(int) zoomLevel
Show the raster tiles at the specified zoom level.
You can control the tile visibility for each zoom level independently. For example, tiles may be visible at levels 0, 5, 7 only. Tiles are shown at all zoom levels by default.
HERE iOS SDK Developer's Guide
► API reference
144
Note:
This method does nothing when the instance is locked. See
.
Parameters:
•
zoomLevel
Zoom level at which to show the tiles. Values outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored
-(void) showFromZoomLevel:(int) fromLevel toZoomLevel:(int) toLevel
Show the raster tiles at the specified zoom level range.
You can control the tile visibility for each zoom level independently. For example, tiles may be visible at levels 0, 5, 7 only. Tiles are shown at all zoom levels by default.
The method will do nothing if ANY parameters fall outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel or if fromLevel > toLevel.
Note:
This method does nothing when the instance is locked. See
.
Parameters:
•
fromLevel
Lower zoom level index at which to show the tiles. Values outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored
•
toLevel
Upper zoom level index at which to show the tiles. Values outside the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored
<NMAMapTileLayerDataSource>
Protocol Summary
protocol
<NMAMapTileLayerDataSource>
Derived from: <NSObject>
An interface for providing tile bitmap data to an NMAMapTileLayer instance.
Include:
NMAKit.framework/headers/NMAMapTileLayer.h
HERE iOS SDK Developer's Guide
► API reference
145
Inheritance Diagrams
Figure 38: Public inheritance diagram for <NMAMapTileLayerDataSource> – <NMAMapTileLayerDataSource>
[For complete information, see the section
Instance Method Summary
Table 43: Instance Method
Instance Methods
*) mapTileLayer hasTileAtX:(NSUInteger) x y:(NSUInteger) y zoomLevel:(NSUInteger) zoomLevel
Indicates if the specified tile should be rendered.
- @optional (NSData *)
(
*) mapTileLayer requestDataForTileAtX:
(NSUInteger) x y:(NSUInteger) y zoomLevel:(NSUInteger) zoomLevel
Requests raw tile bitmap data for the specified tile.
*) mapTileLayer urlForTileAtX:
(NSUInteger) x y:(NSUInteger) y zoomLevel:(NSUInteger) zoomLevel
Returns a URL from which the tile bitmap can be downloaded.
Protocol Details
An interface for providing tile bitmap data to an
instance.
Note:
The methods of this protocol will be called on an internal NMA map rendering queue. Blocking this queue for extended periods of time will adversely effect map rendering performance.
Instance Method Details
- @optional (BOOL) mapTileLayer:(
hasTileAtX:(NSUInteger) x y:(NSUInteger) y zoomLevel:(NSUInteger) zoomLevel
Indicates if the specified tile should be rendered.
HERE iOS SDK Developer's Guide
► API reference
146
If this method returns NO then a further call to request tile bitmap data or tile URL will not be made.
Not implementing this protocol method is equivalent to returning YES.
At each zoomLevel the framework expects the "world" to be rendered on (2^zoomLevel)^2 tiles.
The x and y parameters indicate which tile is being requested for the given zoom level:
• At zoom level 3 the framework will ask you for 8 x 8 tiles
• At zoom level 4 the framework will ask you for 16 x 16 tiles
• ...
Note:
This method is called on an internal NMA map rendering queue. Blocking for extended periods of time will impact map rendering performance.
Parameters:
•
mapTileLayer
instance that is requesting the tile.
•
x
X coordinate of the tile being requested in the range 1..(2^zoomLevel).
•
y
Y coordinate of the tile being requested in the range 1..(2^zoomLevel).
•
zoomLevel
Zoom level of the tile being requested in the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel. The zoomLevel parameter value may NOT have the same value as the zoomLevel property of the
has been added.
Returns:
YES if the requested tile should be rendered, NO otherwise.
- @optional (NSData *) mapTileLayer:(
requestDataForTileAtX:(NSUInteger) x y:(NSUInteger) y zoomLevel:(NSUInteger) zoomLevel
Requests raw tile bitmap data for the specified tile.
Implement this method if you wish to supply raw tile bitmap data. This method will be called whenever the map view needs bitmap data to render the specified tile.
HERE iOS SDK Developer's Guide
► API reference
147
See mapTileLayer:hasTileAtX:y:zoomLevel: for a detailed description of the x, y and zoomLevel parameters.
Implementing this method will prevent mapTileLayer:urlForTileAtX:y:zoomLevel: and mapTileLayer:requestTileAtX:y:zoomLevel:tileRequest from being called.
Note:
This method is called on an internal NMA map rendering queue. Blocking for extended periods of time will impact map rendering performance.
Parameters:
•
mapTileLayer
instance that is requesting the tile bitmap.
•
x
X coordinate of the tile being requested in the range 1..(2^zoomLevel).
•
y
Y coordinate of the tile being requested in the range 1..(2^zoomLevel).
•
zoomLevel
Zoom level of the tile being requested in the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel. The zoomLevel parameter value may NOT have the same value as the zoomLevel property of the
has been added.
Returns:
Raw tile bitmap data.
- @optional (NSString *) mapTileLayer:(
urlForTileAtX:(NSUInteger) x y:(NSUInteger) y zoomLevel:(NSUInteger) zoomLevel
Returns a URL from which the tile bitmap can be downloaded.
Implement this method if you wish to have the framework download tile bitmap data from a URL you provide. This method will be called whenever the map view needs bitmap data to render the specified tile.
This method is provided as a convenience for the common case of downloading bitmaps tiles from a
URL. The data returned from the URL must be in either png and jpg format.
HERE iOS SDK Developer's Guide
► API reference
148
See mapTileLayer:hasTileAtX:y:zoomLevel: for a detailed description of the x, y and zoomLevel parameters.
Note:
This method will not be called if you also implement mapTileLayer:requestTileAtX:y:zoomLevel:tileRequest or mapTileLayer:requestTileAtX:y:zoomLevel This method is called on an internal NMA map rendering queue. Blocking for extended periods of time will impact map rendering performance.
Parameters:
•
mapTileLayer
instance that is requesting the tile URL.
•
x
X coordinate of the tile being requested in the range 1..(2^zoomLevel).
•
y
Y coordinate of the tile being requested in the range 1..(2^zoomLevel).
•
zoomLevel
Zoom level of the tile being requested in the range
NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel. The zoomLevel parameter value may NOT have the same value as the zoomLevel property of the
has been added.
Returns:
URL to fetch the requested tile from.
NMAMapView
Class Summary
class
NMAMapView
Derived from: UIView
A UIView subclass used by an application to display a geographical map.
Include:
NMAKit.framework/headers/NMAMapView.h
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 39: Public inheritance diagram for NMAMapView
[For complete information, see the section
]
Public Property Summary
Table 44: Public Property
Public Property
[readable, weak]
The NMAGeoBoundingBox representing the current screen area of the NMAMapView
[readable, writable, assign]
The distance in points that the copyright logo will be from the left or right edge of the
[readable, writable, assign]
The copyright logo position for the NMAMapView.
[readable, writable, assign]
The distance in points that the copyright logo will be from the top or bottom edge of the
.
[readable, writable, weak] id<
An event handler for the NMAMapView
[readable, writable, assign]
The NMAGeoCoordinates of the world location corresponding to the current screen position of the transformCenter
[readable, writable, weak] id<
>
An optional delegate to receive gestures events
[readable, writable, assign]
Indicates the kinetic panning behaviour of the NMAMapView
[readable, writable, assign]
The touch duration required to trigger a long press gesture
[readable, writable, assign]
149
HERE iOS SDK Developer's Guide
► API reference
Public Property
Indicates the state of enabling and modifying map gesture interaction for the NMAMapView
[readable, writable, assign]
[readable, writable, strong]
NSString *
The scheme for the NMAMapView
[readable, assign]
*
The position indicator for the NMAMapView
[readable, writable, assign]
A flag which can be used to allow or disallow map rendering
[readable, writable, assign]
CGPoint
The point at which map movements and animations are centered
[readable, writable, assign]
[readable, writable, assign]
The zoom level for the NMAMapView
Instance Method Summary
Table 45: Instance Method
Instance Methods
-(BOOL)
(
*) object
Adds a NMAMapObject to the NMAMapView
-(BOOL)
Adds a NSArray of NMAMapObject objects to the NMAMapView
-(void)
*) tileLayer
Adds a NMAMapTileLayer to the map view for rendering custom raster tiles
-(void)
Disable one or more NMAMapView gestures
-(void)
(NSUInteger) gestures
Enable one or more NMAMapView gestures
-(
Converts a specified on-screen point to an equivalent NMAGeoCoordinates object
150
HERE iOS SDK Developer's Guide
► API reference
151
Instance Methods
-(BOOL)
Queries whether or not a gesture type is enabled on the NMAMapView
-(NSArray *)
Returns an array of NMAMapTileLayer instances that have been added to the map view
-(NSArray *)
Returns a NSArray of all NMAMapObject objects that are selected at a specified point on the screen
pointDistanceFromGeoCoordinates:
*) startCoordinates toGeoCoordinates:(
*) endCoordinates
Calculates the point distance between two geo coordinates
(
*) coordinates
Converts a specified NMAGeoCoordinates object to its equivalent point in screen space.
-(BOOL)
Removes an existing NMAMapObject from the NMAMapView
-(BOOL)
(NSArray *) objects
Removes a NSArray of NMAMapObject objects from the NMAMapView
-(void)
*) tileLayer
Removes a NMAMapTileLayer from the map view
-(void)
*) boundingBox insideRect:(CGRect) screenRect
) animationType
Transforms the map to fit an arbitrary geo bounding box with the bounds of a specific screen region with optional animation
-(void)
*) boundingBox withAnimation:(
) animationType
Sets the geo bounding box of the map view with optional animation
-(void)
(
) animationType
Sets the geoCenter of the map with optional animation
-(void)
(
*) geoCenter zoomLevel:(float) zoomLevel
) animationType
Simultaneously sets one or more map transformation properties with optional animation
-(void)
(
*) coordinates toPoint:(CGPoint) point
) animation
Positions the NMAMapView so that the specified world location coincides with the specified screen location
HERE iOS SDK Developer's Guide
► API reference
152
Instance Methods
-(void)
(
*) coordinates toPoint:(CGPoint) point
) animation zoomLevel:(float) zoomLevel
Positions the NMAMapView so that the specified world location coincides with the specified screen location
-(void)
(float) zoomLevel withAnimation:(
) animationType
Sets the zoomLevel of the map with optional animation
-(NSArray *)
(CGPoint) point
Returns a NSArray of all visible NMAMapObject objects that are selected at a specified point on the screen
Class Method Summary
Table 46: Class Method
Class Methods
+(void)
shouldBeginRenderingAutomatically:
Used to control the default NMAMapView rendering behaviour
Class Details
A UIView subclass used by an application to display a geographical map.
Public Property Details
[readable, weak]
The NMAGeoBoundingBox representing the current screen area of the
.
The boundingBox of the map is the smallest possible
map area currently visible on the screen.
Note:
The bounding box may be slightly inaccurate if the method is invoked while the map is moving.
[readable, writable, assign] float copyrightLogoHorizontalMargin
The distance in points that the copyright logo will be from the left or right edge of the
.
Note:
HERE iOS SDK Developer's Guide
► API reference
153
Values less than 10.0 will be ignored. Does not apply when the copyrightLogoPosition is
NMALayoutPositionTopCenter or NMALayoutPositionBottomCenter.
[readable, writable, assign]
copyrightLogoPosition
The copyright logo position for the NMAMapView.
Note:
Valid values are NMALayoutPositionTopLeft, NMALayoutPositionTopCenter,
NMALayoutPositionTopRight, NMALayoutPositionBottomLeft,
NMALayoutPositionBottomCenter, and NMALayoutPositionBottomRight.
[readable, writable, assign] float copyrightLogoVerticalMargin
The distance in points that the copyright logo will be from the top or bottom edge of the
Note:
Values less than 10.0 will be ignored.
[readable, writable, weak]
> delegate
An event handler for the
An object may be installed as the
's delegate in order to respond to certain map events,
such as object selection or map movement. See the
events.
[readable, writable, assign]
* geoCenter
The NMAGeoCoordinates of the world location corresponding to the current screen position of the transformCenter.
[readable, writable, weak]
> gestureDelegate
An optional delegate to receive gestures events.
See also:
HERE iOS SDK Developer's Guide
► API reference
[readable, writable, assign]
BOOL kineticPanningEnabled
Indicates the kinetic panning behaviour of the NMAMapView.
When kinetic panning is enabled, at the conclusion of a pan gesture (when the user's finger is removed from the device), the map will continue moving in the direction and with the speed of the original pan before gradually coming to a stop.
[readable, writable, assign]
NSTimeInterval longPressDuration
The touch duration required to trigger a long press gesture.
Note:
The default value is 1 second.
[readable, writable, assign]
BOOL mapInteractionEnabled
Indicates the state of enabling and modifying map gesture interaction for the NMAMapView.
If enabled, gesture handlers can be enabled to begin gesture handling. If disabled, all gesture handling is disabled and the gesture handler state cannot be modified.
[readable, writable, assign]
mapPPI
[readable, writable, strong]
NSString * mapScheme
The scheme for the NMAMapView.
[readable, assign]
* positionIndicator
The position indicator for the NMAMapView.
[readable, writable, assign]
BOOL renderAllowed
A flag which can be used to allow or disallow map rendering.
154
HERE iOS SDK Developer's Guide
► API reference
155
Note:
Setting renderAllowed to NO guarantees that the map will not draw again (but it will finish if a frame is in the middle of rendering), but the map may not redraw with renderAllowed set to
YES if it is prevented from drawing for another reason. The map can be hinted to redraw (if allowed) by calling setNeedsDisplay.
[readable, writable, assign]
CGPoint transformCenter
The point at which map movements and animations are centered.
The transformCenter is a point within the bounds of the map that is used to orient the map during
transformations. For example, when one of the
setGeoCenter:zoomLevel:withAnimation:
and
methods is used, the specified geocoordinates will be aligned with the
transformCenter on the screen.
The transformCenter is specified in relative coordinates in the range {[0, 1], [0, 1]}, with {0, 0} representing the upper left corner of the map and {1, 1} the lower right corner.
Note:
The default value is {0.5, 0.5}. The center point of map movements caused by gestures will depend on the touch locations of the gestures and not on the transformCenter. Values on or very near the edge of the map will be ignored. Values above the horizon will be ignored.
[readable, writable, assign]
BOOL useHighResolutionMap
[readable, writable, assign] float zoomLevel
The zoom level for the NMAMapView.
Note:
Values must be in the range [NMAMapViewMinimumZoomLevel,
NMAMapViewMaximumZoomLevel]; invalid values will be clamped to this range.
Instance Method Details
-(BOOL) addMapObject:(
Adds a NMAMapObject to the NMAMapView.
HERE iOS SDK Developer's Guide
► API reference
Note:
Returns NO if the object has already been added (duplicates are not allowed).
Parameters:
•
object
A NMAMapObject to add
Returns:
YES if the map object was added successfully, NO otherwise
-(BOOL) addMapObjects:(NSArray *) objects
Adds a NSArray of NMAMapObject objects to the NMAMapView.
Parameters:
•
objects
A NSArray of NMAMapObject objects to add
Returns:
YES if all map objects were added successfully, NO otherwise
-(void) addMapTileLayer:(
to the map view for rendering custom raster tiles.
Note:
Attempting to add a single
not supported and will result in undefined behavior.
Parameters:
•
tileLayer
instance to be added to the map view. Ignores attempts to add the same
instance twice.
-(void) disableMapGestures:(NSUInteger) gestures
gestures.
Note:
156
HERE iOS SDK Developer's Guide
► API reference
Pass NMAMapGestureTypeAll to disable all gestures. Disabling a gesture type will also disable
's gestureDelegate.
Parameters:
•
gestures
A bit-mask combination of one or more NMAMapGestureType values.
-(void) enableMapGestures:(NSUInteger) gestures
Enable one or more
Note:
All gestures are enabled by default. Pass NMAMapGestureTypeAll to enable all gestures.
Parameters:
•
gestures
A bit-mask combination of one or more NMAMapGestureType values.
-(
*) geoCoordinatesFromPoint:(CGPoint) point
Converts a specified on-screen point to an equivalent NMAGeoCoordinates object.
Parameters:
•
point
A point on the screen to convert
Returns:
The NMAGeoCoordinates, or nil if the conversaion failed
-(BOOL) isMapGestureEnabled:(
Queries whether or not a gesture type is enabled on the NMAMapView.
Parameters:
•
gesture
The gesture type to query.
-(NSArray *) mapTileLayers
157
HERE iOS SDK Developer's Guide
► API reference
158
Returns an array of
instances that have been added to the map view.
Returns:
NSArray of
-(NSArray *) objectsAtPoint:(CGPoint) point
Returns a NSArray of all NMAMapObject objects that are selected at a specified point on the screen.
Note:
Use isKindOfClass: to further determine
type instead of isMemberOfClass:.
Parameters:
•
point
An on-screen CGPoint specified in logical coordinates
Returns:
The NSArray of selected NMAMapObject objects
-(double) pointDistanceFromGeoCoordinates:(
startCoordinates toGeoCoordinates:(
Calculates the point distance between two geo coordinates.
Note:
The calculation will fail if the coordinates are too far apart or too far from the current location of the map.
Parameters:
•
startCoordinates
Starting NMAGeoCoordinates
•
endCoordinates
Ending NMAGeoCoordinates
Returns:
The point distance between the NMAGeoCoordinates, or -CGFLOAT_MAX if either of the coordinates
parameters is nil or the calculation cannot be performed.
HERE iOS SDK Developer's Guide
► API reference
159
-(CGPoint) pointFromGeoCoordinates:(
Converts a specified NMAGeoCoordinates object to its equivalent point in screen space.
Valid geo coordinates will produce a valid point, even if the coordinates are not on the screen, as long as the coordinates are not too far from the current map location. To check if coordinates are within the bounds of the screen, use the CGRectContainsPoint method after making the conversion.
Parameters:
•
coordinates
A NMAGeoCoordinates object to convert
Returns:
The on-screen CGPoint, or CGPoint.x = CGPoint.y = -CGFLOAT_MAX if the NMAGeoCoordinates object is nil
-(BOOL) removeMapObject:(
Removes an existing NMAMapObject from the NMAMapView.
Parameters:
•
object
A NMAMapObject to remove
Returns:
YES if the map object was removed successfully, NO otherwise
-(BOOL) removeMapObjects:(NSArray *) objects
Removes a NSArray of NMAMapObject objects from the NMAMapView.
Parameters:
•
objects
A NSArray of NMAMapObject objects to remove
Returns:
YES if all map objects were removed successfully, NO otherwise
-(void) removeMapTileLayer:(
HERE iOS SDK Developer's Guide
► API reference
160
Parameters:
•
tileLayer
instance to be removed from the map view. Does nothing if tileLayer has not been added to the map view yet.
-(void) setBoundingBox:(
(CGRect) screenRect withAnimation:(
Transforms the map to fit an arbitrary geo bounding box with the bounds of a specific screen region with optional animation.
Passing the bounds of the map view to this method is equivalent to calling setBoundingBox:withAnimation:.
Parameters:
•
boundingBox
A NMAGeoBoundingBox to display after the transformation
•
screenRect
The region of the view inside which the bounding box will be located.
•
animationType
The animation method used to perform the transformation.
-(void) setBoundingBox:(
*) boundingBox withAnimation:(
Sets the geo bounding box of the map view with optional animation.
After this method completes, the full extents of the specified geo bounding box will be visible in the map view. Depending on map orientation, this means that the boundingBox property may return a different value than the one passed to this method, because the map may be displaying some areas outside of the input bounding box.
Parameters:
•
boundingBox
A NMAGeoBoundingBox to display after the transformation
•
animationType
HERE iOS SDK Developer's Guide
► API reference
161
A NMAMapAnimation to illustrate the transformation
-(void) setGeoCenter:(
Sets the geoCenter of the map with optional animation.
Parameters:
•
geoCenter
•
animationType
The animation method used to display the transformation.
-(void) setGeoCenter:(
*) geoCenter zoomLevel:(float)
zoomLevel withAnimation:(
Simultaneously sets one or more map transformation properties with optional animation.
Any combination of new properties may be passed to this method. To leave a property unchanged, pass nil (geoCenter) or NMAMapViewPreserveValue (zoomLevel) for that property.
Parameters:
•
geoCenter
The new geoCenter.
•
zoomLevel
The new zoomLevel.
•
animationType
The animation method used to display the transformation.
-(void) setGeoCoordinates:(
(CGPoint) point withAnimation:(
so that the specified world location coincides with the specified screen location.
Note:
HERE iOS SDK Developer's Guide
► API reference
162
The screen point must be within the bounds of the map view. Due to the curvature of the
Earth, positioning may be inaccurate at low zoom levels.
Parameters:
•
coordinates
The world location
•
point
The screen location
•
animation
The NMAMapAnimation type to use while moving the map
-(void) setGeoCoordinates:(
(CGPoint) point withAnimation:(
(float) zoomLevel
so that the specified world location coincides with the specified screen location.
Note:
The screen point must be within the bounds of the map view. Due to the curvature of the
Earth, positioning may be inaccurate at low zoom levels.
Parameters:
•
coordinates
The world location
•
point
The screen location
•
animation
The NMAMapAnimation type to use while moving the map
•
zoomLevel
Desired zoom level of the newly-centered NMAMapView (pass NMAMapViewPreserveValue to keep the current zoom level)
-(void) setZoomLevel:(float) zoomLevel withAnimation:(
animationType
Sets the zoomLevel of the map with optional animation.
HERE iOS SDK Developer's Guide
► API reference
163
Parameters:
•
zoomLevel
The zoomLevel at which to set the map.
•
animationType
The animation method used to display the transformation.
-(NSArray *) visibleObjectsAtPoint:(CGPoint) point
Returns a NSArray of all visible NMAMapObject objects that are selected at a specified point on the screen.
Parameters:
•
point
An on-screen CGPoint specified in logical coordinates
Returns:
The NSArray of selected NMAMapObject objects
Class Method Details
+(void) shouldBeginRenderingAutomatically:(BOOL) enabled
Used to control the default NMAMapView rendering behaviour.
This class method is used to set whether or not instances of NMAMapView will begin rendering immediately upon creation. Any map view created after passing NO to this method must have its renderAllowed property set to YES to begin rendering.
<NMAMapViewDelegate>
Protocol Summary
protocol
<NMAMapViewDelegate>
Derived from: <NSObject>
Represents a delegate that offers listeners and callback methods related to visible actions that result from user interaction.
HERE iOS SDK Developer's Guide
► API reference
Include:
NMAKit.framework/headers/NMAMapView.h
Inheritance Diagrams
Figure 40: Public inheritance diagram for <NMAMapViewDelegate> – <NMAMapViewDelegate>
164
[For complete information, see the section
Instance Method Summary
Table 47: Instance Method
Instance Methods
*) mapView didSelectObjects:(NSArray *) objects
A callback indicating that NMAMapObject map objects have been selected
*) mapView
A callback indicating the beginning of an animation on the map
*) mapView
A callback indicating that a map movement has begun due to user interaction
*) mapView
A callback indicating that map data has been drawn
*) mapView
A callback indicating the end of an animation on the map
(
A callback indicating that a map movement has ended
Protocol Details
Represents a delegate that offers listeners and callback methods related to visible actions that result from user interaction.
Note:
Methods of this protocol are called on the main queue.
HERE iOS SDK Developer's Guide
► API reference
165
Instance Method Details
- @optional (void) mapView:(
*) mapView didSelectObjects:(NSArray
*) objects
A callback indicating that NMAMapObject map objects have been selected.
Parameters:
•
mapView
instance sending the callback
•
objects
A NSArray of selected map objects
- @optional (void) mapViewDidBeginAnimation:(
A callback indicating the beginning of an animation on the map.
Note that this callback is invoked after one of the following operations starts:
• setting the map center (with animation), for exmaple with
setGeoCenter:zoomLevel:withAnimation:
• setting the map zoom level (with animation). E.g. with
- @optional (void) mapViewDidBeginMovement:(
A callback indicating that a map movement has begun due to user interaction.
Note:
This callback will be sent at the start of the gesture when the map is panned or pinch zoomed(only for user gestures). If the map receives more than one of these gestures at the same time, only a single callback will be sent until all map movement has stopped.
- @optional (void) mapViewDidDraw:(
A callback indicating that map data has been drawn.
- @optional (void) mapViewDidEndAnimation:(
A callback indicating the end of an animation on the map.
HERE iOS SDK Developer's Guide
► API reference
This is fired after one of the following operations ends:
•
setting the map center (with animation). E.g. with
setCenter:
• setting the map zoom level (with animation). E.g. with
- @optional (void) mapViewDidEndMovement:(
A callback indicating that a map movement has ended.
Note:
There will be a one-to-one correspondence with this callback and the mapViewDidBeginMovement callback.
NMAPositionIndicator
Class Summary
class
NMAPositionIndicator
Derived from: NSObject
Used to provide a visual indication of the user's current position.
Include:
NMAKit.framework/headers/NMAPositionIndicator.h
Inheritance Diagrams
Figure 41: Public inheritance diagram for NMAPositionIndicator
166
[For complete information, see the section
]
Public Property Summary
Table 48: Public Property
Public Property
[readable, writable, assign]
HERE iOS SDK Developer's Guide
► API reference
167
Public Property
The color of the accuracy indicator circle
[readable, writable, assign]
Indicates whether the NMAPositionIndicator accuracy indicator (the surrounding circle) is visible
[readable, writable, assign]
Indicates whether the NMAPositionIndicator is visible
Class Details
Used to provide a visual indication of the user's current position.
Each instance of
created for it. The position indicator is hidden by default; it can be displayed by change its visible property to YES.
By default, the position indicator displays an
showing a green circle.
The accuracy of the current position is indicated by a circle surrounding the indicator object. The visibility of the accuracy indicator is controlled via the accuracyIndicatorVisible property, and its color may be changed by setting the accuracyIndicatorColor.
Note:
The
correctly, and will automatically start the positioning service when required.
Public Property Details
[readable, writable, assign]
UIColor * accuracyIndicatorColor
The color of the accuracy indicator circle.
[readable, writable, assign]
BOOL accuracyIndicatorVisible
accuracy indicator (the surrounding circle) is visible.
Note:
The getter is isAccuracyIndicatorVisible
.
[readable, writable, assign]
BOOL visible
HERE iOS SDK Developer's Guide
► API reference
Note:
The getter is isVisible
. Setting visible to YES will start
positioning if it is not already active.
168
NMA Routing
Group Summary
group
NMA Routing
The Routing group contains classes, protocols, and enumerations for describing and calculating routes.
[For complete information, see the section
]
Nested Classes
Table 49: Public Nested Classes
Public Nested Classes
Public Enumeration Summary
Table 50: Public Enumeration
Public Enumeration
HERE iOS SDK Developer's Guide
► API reference
169
Public Enumeration
Defines types of actions for a NMAManeuver.
Defines types of icons for a NMAManeuver.
Defines types of traffic directions, the side of the road on which one must drive.
Defines types of turns for a NMAManeuver.
Identifiers for detailed explanation of travel duration (NMARoute::duration) estimates relating to a route.
Defines types of route element.
Defines types of error codes that can be returned from route calculation operations.
Implicit routing options that may be violated by routes returned from
.
Represents values describing routing options that can be used to enforce special conditions on a calculated route.
Represents values describing different routing types.
Represents values describing different transport modes, the mode of transportation a person will be using to travel a route
(e.g. a car).
Group Details
The Routing group contains classes, protocols, and enumerations for describing and calculating routes. The key class to this group is
Public Enumeration Details
NMAManeuverAction
Include:
NMAKit.framework/headers/NMAManeuver.h
HERE iOS SDK Developer's Guide
► API reference
Defines types of actions for a
Enumeration Members:
•
NMAManeuverActionUndefined
An undefined action.
•
NMAManeuverActionNone
An indication there is no action associated with the maneuver.
•
NMAManeuverActionEnd
An action that indicates the end of a route.
•
NMAManeuverActionStopover
An action that indicates a stopover.
•
NMAManeuverActionJunction
An action that indicates a junction.
•
NMAManeuverActionRoundabout
An action that indicates a roundabout.
•
NMAManeuverActionUTurn
An action that indicates a u-turn.
•
NMAManeuverActionEnterHighwayFromRight
An action that indicates entering a highway from the right.
•
NMAManeuverActionEnterHighwayFromLeft
An action that indicates entering a highway from the left.
•
NMAManeuverActionEnterHighway
An action that indicates entering a highway.
•
NMAManeuverActionLeaveHighway
An action that indicates leaving a highway.
•
NMAManeuverActionChangeHighway
An action that indicates changing from one highway to another.
•
NMAManeuverActionContinueHighway
An action that indicates continuing along a highway.
•
NMAManeuverActionFerry
An action that indicates boarding a ferry.
•
NMAManeuverActionPassJunction
An action that indicates passing a junction.
•
NMAManeuverActionInvalid
170
HERE iOS SDK Developer's Guide
► API reference
171
An invalid action.
NMAManeuverIcon
Include:
NMAKit.framework/headers/NMAManeuver.h
.
Note:
NMAManeuverIcon enum is simplified version of all valid NMAManeuverAction and
NMAManeuverTurn combinations. It can be used to provide navigation directions, but for more detailed representation, use NMAManeuverAction in conjunction with NMAManeuverTurn.
Enumeration Members:
•
NMAManeuverIconUndefined
An undefined icon.
•
NMAManeuverIconGoStraight
An icon that indicates a straight heading.
•
NMAManeuverIconUTurnRight
An icon that indicates a right u-turn.
•
NMAManeuverIconUTurnLeft
An icon that indicates a left u-turn.
•
NMAManeuverIconKeepRight
An icon that indicates keeping to the right.
•
NMAManeuverIconLightRight
An icon that indicates a light right turn.
•
NMAManeuverIconQuiteRight
An icon that indicates a normal right turn.
•
NMAManeuverIconHeavyRight
An icon that indicates a heavy right turn.
•
NMAManeuverIconKeepMiddle
An icon that indicates keeping to the left.
•
NMAManeuverIconKeepLeft
An icon that indicates keeping to the middle line.
•
NMAManeuverIconLightLeft
HERE iOS SDK Developer's Guide
► API reference
An icon that indicates a light left turn.
•
NMAManeuverIconQuiteLeft
An icon that indicates a normal left turn.
•
NMAManeuverIconHeavyLeft
An icon that indicates a heavy left turn.
•
NMAManeuverIconEnterHighwayRightLane
An icon that indicates entering a highway into the right lane.
•
NMAManeuverIconEnterHighwayLeftLane
An icon that indicates entering a highway into the left lane.
•
NMAManeuverIconLeaveHighwayRightLane
An icon that indicates leaving a highway from the right lane.
•
NMAManeuverIconLeaveHighwayLeftLane
An icon that indicates from the left lane.
•
NMAManeuverIconHighwayKeepRight
An icon that indicates keeping to the right.
•
NMAManeuverIconHighwayKeepLeft
An icon that indicates keeping to the left.
•
NMAManeuverIconRoundabout1
An icon that indicates using the first exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout2
An icon that indicates using the second exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout3
An icon that indicates using the third exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout4
An icon that indicates using the fourth exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout5
An icon that indicates using the fifth exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout6
172
HERE iOS SDK Developer's Guide
► API reference
An icon that indicates using the sixth exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout7
An icon that indicates using the seventh exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout8
An icon that indicates using the eighth exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout9
An icon that indicates using the ninth exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout10
An icon that indicates using the tenth exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout11
An icon that indicates using the eleventh exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout12
An icon that indicates using the twelfth exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout1LH
An icon that indicates using the first exit encountered while navigating a roundabout in a counter-clockwise direction.
•
NMAManeuverIconRoundabout2LH
An icon that indicates using the second exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout3LH
An icon that indicates using the third exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout4LH
An icon that indicates using the fourth exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout5LH
173
HERE iOS SDK Developer's Guide
► API reference
An icon that indicates using the fifth exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout6LH
An icon that indicates using the sixth exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout7LH
An icon that indicates using the seventh exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout8LH
An icon that indicates using the eighth exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout9LH
An icon that indicates using the ninth exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout10LH
An icon that indicates using the tenth exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout11LH
An icon that indicates using the eleventh exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconRoundabout12LH
An icon that indicates using the twelfth exit encountered while navigating a roundabout in a clockwise direction.
•
NMAManeuverIconStart
An icon that indicates the start point (displayed when route navigation has not yet begun).
•
NMAManeuverIconEnd
An icon that indicates the destination point.
•
NMAManeuverIconFerry
An icon that indicates boarding a ferry.
NMAManeuverTrafficDirection
Include:
NMAKit.framework/headers/NMAManeuver.h
Defines types of traffic directions, the side of the road on which one must drive.
174
HERE iOS SDK Developer's Guide
► API reference
Enumeration Members:
•
NMAManeuverTrafficDirectionLeft
Traffic flows on the left side of the road, as in the UK.
•
NMAManeuverTrafficDirectionRight
Traffic flows on the right side of the road, as in the USA.
NMAManeuverTurn
Include:
NMAKit.framework/headers/NMAManeuver.h
.
Enumeration Members:
•
NMAManeuverTurnUndefined
An undefined turn.
•
NMAManeuverTurnNone
Indicates that no turn is necessary.
•
NMAManeuverTurnKeepMiddle
A turn that indicates keeping to the middle when a road forks.
•
NMAManeuverTurnKeepRight
A turn that indicates keeping to the right when a road forks.
•
NMAManeuverTurnLightRight
A turn that indicates making a light right turn.
•
NMAManeuverTurnQuiteRight
A turn that indicates making a normal right turn.
•
NMAManeuverTurnHeavyRight
A turn that indicates making a heavy right turn.
•
NMAManeuverTurnKeepLeft
A turn that indicates keeping to the left when a road forks.
•
NMAManeuverTurnLightLeft
A turn that indicates making a light left turn.
•
NMAManeuverTurnQuiteLeft
A turn that indicates making a normal left turn.
•
NMAManeuverTurnHeavyLeft
175
HERE iOS SDK Developer's Guide
► API reference
A turn that indicates making a heavy left turn.
•
NMAManeuverTurnReturn
A turn that indicates a u-turn, turning around.
•
NMAManeuverTurnRoundabout1
A turn that indicates taking the first exit of a roundabout.
•
NMAManeuverTurnRoundabout2
A turn that indicates taking the second exit of a roundabout.
•
NMAManeuverTurnRoundabout3
A turn that indicates taking the third exit of a roundabout.
•
NMAManeuverTurnRoundabout4
A turn that indicates taking the fourth exit of a roundabout.
•
NMAManeuverTurnRoundabout5
A turn that indicates taking the fifth exit of a roundabout.
•
NMAManeuverTurnRoundabout6
A turn that indicates taking the sixth exit of a roundabout.
•
NMAManeuverTurnRoundabout7
A turn that indicates taking the seventh exit of a roundabout.
•
NMAManeuverTurnRoundabout8
A turn that indicates taking the eighth exit of a roundabout.
•
NMAManeuverTurnRoundabout9
A turn that indicates taking the ninth exit of a roundabout.
•
NMAManeuverTurnRoundabout10
A turn that indicates taking the tenth exit of a roundabout.
•
NMAManeuverTurnRoundabout11
A turn that indicates taking the eleventh exit of a roundabout.
•
NMAManeuverTurnRoundabout12
A turn that indicates taking the twelfth exit of a roundabout.
NMARouteDurationDetail
Include:
NMAKit.framework/headers/NMARouteTta.h
Identifiers for detailed explanation of travel duration (NMARoute::duration) estimates relating to a route.
176
HERE iOS SDK Developer's Guide
► API reference
Note:
This is a bitwise enum. If none of the bit is set, NMARouteDurationDetailAccurate is assumed
Enumeration Members:
•
NMARouteDurationDetailAccurate
The estimate is accurate.
•
NMARouteDurationDetailBlockedRoad
The route uses a road that is blocked.
•
NMARouteDurationDetailCarPool
The route uses a road with carpool restriction.
•
NMARouteDurationDetailRestrictedTurn
The route uses a restricted turn.
NMARouteElementType
Include:
NMAKit.framework/headers/NMARouteElement.h
Defines types of route element.
Enumeration Members:
•
NMARouteElementRoad
Road Element
•
NMARouteElementInvalid
invalid
NMARouteManagerError
Include:
NMAKit.framework/headers/NMARouteManager.h
Defines types of error codes that can be returned from route calculation operations.
Enumeration Members:
•
NMARouteManagerErrorNone
There was no error, route calculation succeeded.
•
NMARouteManagerErrorUnknown
There was an unknown error.
•
NMARouteManagerErrorOutOfMemory
177
HERE iOS SDK Developer's Guide
► API reference
178
There was an out-of-memory error.
•
NMARouteManagerErrorInvalidParameters
There was an error due to invalid parameters.
•
NMARouteManagerErrorInvalidOperation
There was an error due to another request already being processed.
•
NMARouteManagerErrorGraphDisconnected
There was an error because no route could be found.
•
NMARouteManagerErrorGraphDisconnectedCheckOptions
There was an error because no route could be found, possibly due to some option (e.g. disabled highways) preventing it.
•
NMARouteManagerErrorNoStartPoint
There was an error because no starting waypoint could be found.
•
NMARouteManagerErrorNoEndPoint
There was an error because no destination waypoint could be found.
•
NMARouteManagerErrorNoEndPointCheckOptions
There was an error because the destination point is unreachable, possibly due to some option
(e.g. disabled highways) preventing it.
•
NMARouteManagerErrorCannotDoPedestrian
There was an error because pedestrian mode was specified yet is not practical (e.g. the route is too long).
•
NMARouteManagerErrorRoutingCancelled
There was an error because the application user cancelled the route calculation.
•
NMARouteManagerErrorViolatesOptions
There was an error because the route calculation request included options that prohibit successful completion.
•
NMARouteManagerErrorRouteCorrupted
There was an error because the service could not digest the requested route parameters.
•
NMARouteManagerErrorInvalidCredentials
There was an error due to invalid or missing Nokia Developer credentials.
NMARouteViolatedOption
Include:
NMAKit.framework/headers/NMARouteManager.h
HERE iOS SDK Developer's Guide
► API reference
Implicit routing options that may be violated by routes returned from
.
Enumeration Members:
•
NMARouteViolatedOptionNone
The returned route does not violate any options
•
NMARouteViolatedOptionBlockedRoad
The route passes through a blocked road (e.g. due to construction)
•
NMARouteViolatedOptionTurnRestriction
The route passes through a road with a time-based turn restriction
NMARoutingOption
Include:
NMAKit.framework/headers/NMARoutingMode.h
Represents values describing routing options that can be used to enforce special conditions on a calculated route.
Enumeration Members:
•
NMARoutingOptionAvoidBoatFerry
The routing engine will avoid links that are part of a boat ferry passage.
•
NMARoutingOptionAvoidDirtRoad
The routing engine will avoid links that are part of a dirt road.
•
NMARoutingOptionAvoidHighway
The routing engine will avoid links that are part of a highway.
Note:
Effective only when used with
•
NMARoutingOptionAvoidPark
The routing engine will avoid links that go through a park.
Note:
Effective only when used with
.
•
NMARoutingOptionAvoidTollRoad
The routing engine will avoid links that are part of a toll road.
Note:
Effective only when used with
•
NMARoutingOptionAvoidTunnel
179
HERE iOS SDK Developer's Guide
► API reference
180
The routing engine will avoid links that are part of a tunnel.
Note:
Effective only when used with
•
NMARoutingOptionAvoidCarShuttleTrain
The routing engine will avoid links that are part of a motorail train or car shuttle train passage.
•
NMARoutingOptionAvoidCarpool
The routing engine will avoid HOV/Carpool roads.
NMARoutingType
Include:
NMAKit.framework/headers/NMARoutingMode.h
Represents values describing different routing types.
Enumeration Members:
•
NMARoutingTypeShortest
Search for the shortest route, taking road conditions and restrictions into account (minimizes travel distance).
•
NMARoutingTypeFastest
Search for the fastest route, taking road conditions and restrictions into account (minimizes travel time).
NMATransportMode
Include:
NMAKit.framework/headers/NMARoutingMode.h
Represents values describing different transport modes, the mode of transportation a person will be using to travel a route (e.g. a car).
Enumeration Members:
•
NMATransportModeCar
A car is being used as the mode of transportation.
•
NMATransportModePedestrian
Walking is being used as the mode of transportation.
HERE iOS SDK Developer's Guide
► API reference
181
NMAManeuver
Class Summary
class
NMAManeuver
Derived from: NSObject
Represents a maneuver, which is the action required to leave one street segment and enter the next in the linked chain of directions that comprises a calculated NMARoute.
Include:
NMAKit.framework/headers/NMAManeuver.h
Inheritance Diagrams
Figure 42: Public inheritance diagram for NMAManeuver
[For complete information, see the section
]
Public Property Summary
Table 51: Public Property
Public Property
[readable, assign]
The NMAManeuverAction to take for the maneuver
[readable, weak]
The NMAGeoCoordinates of the maneuver
[readable, assign]
The distance from the previous maneuver along the route to the NMAManeuver, in meters
[readable, assign]
The distance from the start of the route to the maneuver, in meters
[readable, assign]
The distance to the next maneuver along the route to the NMAManeuver, in meters
HERE iOS SDK Developer's Guide
► API reference
182
Public Property
[readable, assign]
The NMAManeuverIcon for the NMAManeuver
[readable, assign]
The angle (from north) at the start of the maneuver, in degrees
[readable, weak]
The name of the road to which the NMAManeuver leads
[readable, weak]
The number of the road to which the maneuver leads, a short label for the road, (e
[readable, weak]
The name of the road on which the NMAManeuver takes place, nil if not available
[readable, weak]
The number of the road on which the NMAManeuver takes place, a short label for the road, (e
[readable, assign]
The list of NMARouteElement (or instances of classes derived from it) within the maneuver object
[readable, assign]
Gets the signpost information for this maneuver
[readable, weak]
NSDate *
The (estimated) time at which the maneuver starts in UTC
[readable, assign]
Gets the transport mode for the maneuver
[readable, assign]
The NMAManeuverTurn to take for the maneuver
Class Details
Represents a maneuver, which is the action required to leave one street segment and enter the next in the linked chain of directions that comprises a calculated NMARoute.
Public Property Details
[readable, assign]
action
The NMAManeuverAction to take for the maneuver.
HERE iOS SDK Developer's Guide
► API reference
Note:
If the action for the maneuver is undefined, attempts to read this property will return
NMAManeuverActionUndefined.
[readable, weak]
The NMAGeoCoordinates of the maneuver.
[readable, assign]
NSUInteger distanceFromPreviousManeuver
The distance from the previous maneuver along the route to the NMAManeuver, in meters.
[readable, assign]
NSUInteger distanceFromStart
The distance from the start of the route to the maneuver, in meters.
[readable, assign]
NSUInteger distanceToNextManeuver
The distance to the next maneuver along the route to the NMAManeuver, in meters.
[readable, assign]
icon
The NMAManeuverIcon for the NMAManeuver.
Note:
If the icon type for the maneuver is undefined, attempts to read this property will return
NMAManeuverIconUndefined.
[readable, assign]
NSUInteger mapOrientation
The angle (from north) at the start of the maneuver, in degrees.
Note:
Zero represents true-north, with increasing values representing a clockwise progression of map orientation.
[readable, weak]
NSString * nextRoadName
183
HERE iOS SDK Developer's Guide
► API reference
184
The name of the road to which the NMAManeuver leads. nil if not available. If not available, it should be left blank. It's erroneous to assume that that may be the same as some maneuver along the route.
Note:
It is localized to the locale of the region.
[readable, weak]
NSString * nextRoadNumber
The number of the road to which the maneuver leads, a short label for the road, (e.g. 5 for Interstate
5). nil if not available. If not available, it should be left blank. It's erroneous to assume that that may be the same as some maneuver along the route.
Note:
It is localized to the locale of the region.
[readable, weak]
NSString * roadName
The name of the road on which the NMAManeuver takes place, nil if not available. If not available, it should be left blank. It's erroneous to assume that that may be the same as prior maneuvers.
Note:
It is localized to the locale of the region.
[readable, weak]
NSString * roadNumber
The number of the road on which the NMAManeuver takes place, a short label for the road, (e.g. 5 for the Interstate 5).
Note:
If the road number for the maneuver is unknown, attempts to read this property will return an empty NSString. nil if not available. If not available, it should be left blank. It's erroneous to assume that that may be the same as prior maneuvers. It is localized to the locale of the region.
[readable, assign]
NSArray * routeElements
The list of
(or instances of classes derived from it) within the maneuver object.
HERE iOS SDK Developer's Guide
► API reference
185
[readable, assign]
* signpost
Gets the signpost information for this maneuver.
Note:
nil if no signpost information for this maneuver.
[readable, weak]
NSDate * startTime
The (estimated) time at which the maneuver starts in UTC.
Note:
The departure time must be set in
before routing. nil if not available.
[readable, assign]
transportMode
Gets the transport mode for the maneuver. This might differ from the transport mode used for route calculation. For example, in the case where a route is calculated using public transport, the overall route is a public transport route, but some individual maneuvers may be pedestrian (e.g. walking to a bus stop, transfers which involve walking to a new stop, etc.).
[readable, assign]
turn
The NMAManeuverTurn to take for the maneuver.
Note:
If the turn for the maneuver is undefined, attempts to read this property will return
NMAManeuverTurnUndefined.
NMARoute
Class Summary
class
NMARoute
Derived from: NSObject
Represents a path (a collection of maneuvers) connecting two or more waypoints.
Include:
NMAKit.framework/headers/NMARoute.h
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 43: Public inheritance diagram for NMARoute
[For complete information, see the section
]
Public Property Summary
Table 52: Public Property
Public Property
[readable, strong]
The smallest NMAGeoBoundingBox that contains the entire NMARoute
[readable, weak]
The destination NMAWaypoint for the NMARoute
[readable, assign]
The length of the NMARoute, in meters
[readable, strong]
Array of NMAManeuver to represent all the maneuvers that travelers will encounter along the NMARoute
[readable, strong]
*
The NMAMapPolyline representation of the route
[readable, strong]
*
The NMARoutingMode for the NMARoute
[readable, weak]
The starting
for the NMARoute.
[readable, assign]
Returns the number of sub-legs the route has a subleg is the part of a route between two stop waypoints
[readable, assign]
[readable, writable, strong]
NSString *
186
HERE iOS SDK Developer's Guide
► API reference
187
Public Property
[readable, strong]
Array of NMAWaypoint for all waypoints of the NMARoute
Protected Variable Summary
Table 53: Protected Variable
Protected Variable
FOUNDATION_EXPORT NSInteger const
A constant used to indicate the whole route should be used in route leg selection.
Instance Method Summary
Table 54: Instance Method
Instance Methods
-(
(NSUInteger) subleg
object of traveling the specified subLeg of the
Class Details
Represents a path (a collection of maneuvers) connecting two or more waypoints.
Waypoints may be thought of as the input to a route calculation whereas maneuvers are the results of calculating a route.
Public Property Details
[readable, strong]
* boundingBox
The smallest
that contains the entire NMARoute.
[readable, weak]
The destination
[readable, assign]
NSUInteger length
HERE iOS SDK Developer's Guide
► API reference
188
The length of the NMARoute, in meters. This is the actual distance covered if you were to travel the route.
[readable, strong]
NSArray * maneuvers
Array of
to represent all the maneuvers that travelers will encounter along the
NMARoute.
[readable, strong]
* mapPolyline
The
[readable, strong]
* routingMode
The
for the NMARoute.
[readable, weak]
for the NMARoute.
[readable, assign]
NSUInteger sublegCount
Returns the number of sub-legs the route has a subleg is the part of a route between two stop waypoints.
[readable, assign]
* tta
The
[readable, writable, strong]
NSString * userTag
A user-defined tag to identify the NMARoute
Note:
The default value for userTag is empty string.
HERE iOS SDK Developer's Guide
► API reference
[readable, strong]
NSArray * waypoints
Array of
for all waypoints of the NMARoute.
Protected Variable Details
FOUNDATION_EXPORT NSInteger const NMARouteSublegWhole
A constant used to indicate the whole route should be used in route leg selection.
Instance Method Details
-(
*) ttaForSubleg:(NSUInteger) subleg
The
object of traveling the specified subLeg of the
Parameters:
•
subleg
The index of the subleg on the
to be used for this calculation. If
NMARouteSublegWhole is provided, it is the same as tta property.
NMARouteElement
Class Summary
class
NMARouteElement
Derived from: NSObject
Represents a generic container for an element of a route.
Include:
NMAKit.framework/headers/NMARouteElement.h
Inheritance Diagrams
Figure 44: Public inheritance diagram for NMARouteElement
189
HERE iOS SDK Developer's Guide
► API reference
[For complete information, see the section
]
Public Property Summary
Table 55: Public Property
Public Property
[readable, assign]
Road element of the route element
[readable, assign]
The route element type
Class Details
Represents a generic container for an element of a route.
Public Property Details
[readable, assign]
* roadElement
Road element of the route element.
Note:
nil if type of the route element is not NMARouteElementRoad
[readable, assign]
type
The route element type.
NMARouteManager
Class Summary
class
NMARouteManager
Derived from: NSObject
190
HERE iOS SDK Developer's Guide
► API reference
191
Represents a manager responsible for calculating a
from a list of stops and (optionally) a
.
Include:
NMAKit.framework/headers/NMARouteManager.h
Inheritance Diagrams
Figure 45: Public inheritance diagram for NMARouteManager
[For complete information, see the section
]
Public Property Summary
Table 56: Public Property
Public Property
[readable, assign]
Indicates whether or not the NMARouteManager is currently calculating a route
[readable, writable, weak] id<
The NMARouteManagerDelegate that listens for messages from the NMARouteManager
Instance Method Summary
Table 57: Instance Method
Instance Methods
-(BOOL)
Starts a route calculation with the given stop list and the default
-(BOOL)
(NSArray *) stops routingMode:(
Starts a route calculation with the give stop list and routing mode
-(BOOL)
Cancels the current route calculation.
HERE iOS SDK Developer's Guide
► API reference
192
Class Method Summary
Table 58: Class Method
Class Methods
+(
Returns the NMARouteManager singleton instance
Class Details
Represents a manager responsible for calculating a
from a list of stops and (optionally) a
.
is used to monitor route calculation progress and route calculation completion. Set the
delegate property in order to receive callbacks through
protocol.
The current status of the
can be checked via the busy property.
only supports one routing request at a time. Attempts to make another request before the current request has finished will fail.
requires valid authentication credentials to be set via
. If valid credentials are not present the API may not function correctly or may stop functioning correctly in the future when server side configurations change.
Routing within China is supported, but routes may not cross the Chinese border. Thus, any route calculation which begins, ends, or passes through China and involves one or more other countries will fail.
Public Property Details
[readable, assign]
BOOL busy
is currently calculating a route.
Note:
Any requests made while the
is busy will fail.
[readable, writable, weak]
> delegate
The NMARouteManagerDelegate that listens for messages from the NMARouteManager.
HERE iOS SDK Developer's Guide
► API reference
193
Instance Method Details
-(BOOL) calculateRouteWithStops:(NSArray *) stops
Starts a route calculation with the given stop list and the default
.
The array of stops used to calculate the route must have at least two items. Any of the following may be included in any combination:
1.
2.
3.
4.
If a request is made while a previous request is still in progress, this method will return NO and no callback will be sent to the delegate. If there is not another request in progress but the parameters of the current request are invalid, this method will return NO and a callback will be sent to the delegate.
Note:
for the default routing mode properties.
routeManager:didCalculateRoutes:withError:violatedOptions: will be called upon success. The returned route will contain a list of NMAWayPoints based on the stop locations; the original stops will be not be returned.
Parameters:
•
stops
A list of stops to route between
Returns:
YES if the route calculation request was made successfully, NO otherwise
-(BOOL) calculateRouteWithStops:(NSArray *) stops routingMode:(
Starts a route calculation with the give stop list and routing mode.
Note:
routeManager:didCalculateRoutes:withError:violatedOptions: will be called upon completion.
Parameters:
•
stops
HERE iOS SDK Developer's Guide
► API reference
194
A list of stops to route between
•
mode
Returns:
YES if route calculation was successful, NO otherwise
See also:
-(BOOL) cancel
Cancels the current route calculation.
If route calculation has been started, calling this method cancels the calculation and then notifies the delegate by way of calling routeManager:didCalculateRoutes:withError:violatedOptions: with error code NMARouteManagerErrorRoutingCancelled. If routing calculation could not be cancelled (e.g.
no existing calculation is being performed), the delegate will not be notified and NO will be returned from this method.
Returns:
YES if the cancellation can be processed, NO otherwise
Class Method Details
+(
Returns the NMARouteManager singleton instance.
Note:
Use this method to obtain a NMARouteManager instance. Do not call init directly.
Returns:
shared NMARouteManager instance
HERE iOS SDK Developer's Guide
► API reference
<NMARouteManagerDelegate>
Protocol Summary
protocol
<NMARouteManagerDelegate>
Derived from: <NSObject>
Represents a delegate to handle
Include:
NMAKit.framework/headers/NMARouteManager.h
Inheritance Diagrams
Figure 46: Public inheritance diagram for <NMARouteManagerDelegate> – <NMARouteManagerDelegate>
195
[For complete information, see the section
Instance Method Summary
Table 59: Instance Method
Instance Methods
-(void)
(
*) routeManager didCalculateRoutes:(NSArray *) routes
) error violatedOptions:(NSArray *) violatedOptions
Callback upon completion of route calculation
*) routeManager didUpdateProgress:(float) progress
Callback for reporting the progress of route calculation; values range from 0
Protocol Details
Represents a delegate to handle
Methods of this protocol are called on the main queue.
HERE iOS SDK Developer's Guide
► API reference
196
Instance Method Details
-(void) routeManager:(
*) routeManager didCalculateRoutes:
(NSArray *) routes withError:(
(NSArray *) violatedOptions
Callback upon completion of route calculation.
Parameters:
•
routeManager
instance which calculated the route.
•
routes
objects representing alternate route solutions, or nil if route
calculation failed. The route at index 0 is the best result found. The number of routes in the array
will be less than or equal to the resultCount property specified in the
the route request.
•
error
A routing calculation error. See NMARouteManagerError for possible error codes. If
NMARouteManagerErrorRouteUseDisabledRoads is returned then violatedOptions
is not empty (the returned
is valid and can be used for navigation although it uses roads
which were disabled in the original
NMARoutingMode::routingOptions
•
violatedOptions
An NSArray of NSNumber objects, one per route calculated, representing which options (if any) were violated for the corresponding route. The NSNumber objects should be converted to
NSUInteger before checking. The value will be an OR combination of NMARoutingOption and
NMARouteViolatedOption values, or NMARouteViolatedOptionNone if no options were violated. If route calculation failed, the array will contain a single object containing all the routing options (if any).
- @optional (void) routeManager:(
didUpdateProgress:(float) progress
Callback for reporting the progress of route calculation; values range from 0.0 (starting) to 1.0
(complete).
Note:
In certain circumstances a recalculation is required and this percentage will go from 1.0 to 0.0
Parameters:
HERE iOS SDK Developer's Guide
► API reference
•
routeManager
•
progress
The progress of the current routing operation.
NMARouteTta
Class Summary
class
NMARouteTta
Derived from: NSObject
Describes Time to Arrival details of a NMARoute or a subleg of a NMARoute.
Include:
NMAKit.framework/headers/NMARouteTta.h
Inheritance Diagrams
Figure 47: Public inheritance diagram for NMARouteTta
[For complete information, see the section
]
Public Property Summary
Table 60: Public Property
Public Property
[readable, assign]
Whether a blocked road is present
[readable, assign]
[readable, assign]
Duration in seconds
197
HERE iOS SDK Developer's Guide
► API reference
Class Details
Describes Time to Arrival details of a
or a subleg of a
.
Public Property Details
[readable, assign]
BOOL blocked
Whether a blocked road is present.
[readable, assign]
details
[readable, assign]
NSTimeInterval duration
Duration in seconds. -1 if not available.
NMARoutingMode
Class Summary
class
NMARoutingMode
Derived from: NSObject
.
Include:
NMAKit.framework/headers/NMARoutingMode.h
Inheritance Diagrams
Figure 48: Public inheritance diagram for NMARoutingMode
[For complete information, see the section
]
198
HERE iOS SDK Developer's Guide
► API reference
199
Public Property Summary
Table 61: Public Property
Public Property
[readable, writable, strong]
The desired departure time
[readable, writable, assign]
The maximum number of alternative routes to calculate
[readable, writable, assign]
The OR-ed NMARoutingOption values for the NMARoutingMode
[readable, writable, assign]
The NMARoutingType for the NMARoutingMode
[readable, writable, assign]
The NMATransportMode for the NMARoutingMode
Instance Method Summary
Table 62: Instance Method
Instance Methods
Initializes a NMARoutingMode instance with default values
(
) transportMode routingOptions:(NSUInteger) routingOptions
Initializes a NMARoutingMode instance with the specified routing parameters
Class Details
Represents a model of the parameters required for one route calculation, encapsulating parameters such as:
•
•
•
HERE iOS SDK Developer's Guide
► API reference
200
Public Property Details
[readable, writable, strong]
NSDate * departureTime
The desired departure time.
[readable, writable, assign]
NSUInteger resultLimit
The maximum number of alternative routes to calculate. The actual number calculated may be less.
The default value is 1.
Note:
Only one result will be returned for routes with more than two waypoints.
[readable, writable, assign]
NSUInteger routingOptions
values for the NMARoutingMode.
Note:
The default value is 0 (no options selected).
[readable, writable, assign]
routingType
The NMARoutingType for the NMARoutingMode.
Note:
The default value is NMARoutingTypeShortest.
[readable, writable, assign]
transportMode
The NMATransportMode for the NMARoutingMode.
Note:
The default value is NMATransportModeCar.
Instance Method Details
-(id) init
HERE iOS SDK Developer's Guide
► API reference
201
Initializes a NMARoutingMode instance with default values.
-(id) initWithRoutingType:(
) transportMode routingOptions:(NSUInteger) routingOptions
Initializes a NMARoutingMode instance with the specified routing parameters.
Parameters:
•
routingType
- A routing type (see
)
•
transportMode
)
•
routingOptions
- An OR-ed combination of routing options (see
Returns:
The NMARoutingMode object, or nil if initialization failed
NMASignpost
Class Summary
class
NMASignpost
Derived from: NSObject
This class stores signpost information along the Route.
Include:
NMAKit.framework/headers/NMASignpost.h
Inheritance Diagrams
Figure 49: Public inheritance diagram for NMASignpost
[For complete information, see the section
]
HERE iOS SDK Developer's Guide
► API reference
202
Public Property Summary
Table 63: Public Property
Public Property
[readable, assign]
The exit text of the signpost
Class Details
This class stores signpost information along the Route.
Public Property Details
[readable, assign]
NSString * exitText
The exit text of the signpost.
NMAWaypoint
Class Summary
class
NMAWaypoint
Derived from: NSObject
Waypoints define a route's stopovers, including its start point it's destination point and any points in between.
Include:
NMAKit.framework/headers/NMAWaypoint.h
Inheritance Diagrams
Figure 50: Public inheritance diagram for NMAWaypoint
[For complete information, see the section
]
HERE iOS SDK Developer's Guide
► API reference
203
Public Property Summary
Table 64: Public Property
Public Property
[readable, strong]
The NMAGeoCoordinates representing the mapped position of the NMAWaypoint - the coordinates adjusted by the routing request
[readable, strong]
The NMAGeoCoordinates representing the original position of the NMAWaypoint - typically the coordinates passed into a routing request
Class Details
Waypoints define a route's stopovers, including its start point it's destination point and any points in between.
Each waypoint represents a position along an
, this includes:
• The original (input) coordinates specified as part of a search request or
• The adjusted coordinates used to calculate the route. For example, the routing engine may adjust the input coordinates so that they fall upon a road. The process of adjusting the coordinates is known as map matching.
Note:
A waypoint can represent the result of map matching.
Public Property Details
[readable, strong]
* mappedPosition
The NMAGeoCoordinates representing the mapped position of the NMAWaypoint - the coordinates adjusted by the routing request.
[readable, strong]
* originalPosition
The
representing the original position of the NMAWaypoint - typically the coordinates passed into a routing request.
HERE iOS SDK Developer's Guide
► API reference
204
NMA Search
Group Summary
group
NMA Search
The Search group provides classes, protocols, and enumerations for performing place and geocoder searches.
[For complete information, see the section
]
Nested Classes
Table 65: Public Nested Classes
Public Nested Classes
HERE iOS SDK Developer's Guide
► API reference
Public Nested Classes
Public Typedef Summary
Table 66: Public Typedef
Public Typedef
(void) (^
NMAPlacesCategoriesCompletionBlock
) (NSArray *categories, NSError *error)
A typedef of a block parameter signature used with
NMAPlaces::refreshTopLevelCategoriesWithCompletion:
.
(void) (^
) (NMARequest *request, id data, NSError *error)
A typedef of a block parameter signature used with
.
Public Enumeration Summary
Table 67: Public Enumeration
Public Enumeration
Defines types of categories filter.
Represents available NMAMedia derived objects.
Search result text output formats.
205
HERE iOS SDK Developer's Guide
► API reference
206
Public Variable Summary
Table 68: Public Variable
Public Variable
FOUNDATION_EXPORT NSString *const
Places Reference Source for building IDs.
FOUNDATION_EXPORT NSString *const
Places Reference Source for core POI IDs.
FOUNDATION_EXPORT NSString *const
Places Reference Source for sharing IDs.
FOUNDATION_EXPORT NSString *const
Places Reference Source for all types of venue IDs.
FOUNDATION_EXPORT NSString *const
Places Reference Source for venue content IDs.
FOUNDATION_EXPORT NSString *const
NMAPlacesSourceVenuesDestination
Places Reference Source for venue destination IDs.
FOUNDATION_EXPORT NSString *const
Places Reference Source for venue IDs.
FOUNDATION_EXPORT NSString *const
Group Details
The Search group provides classes, protocols, and enumerations for performing place and geocoder
searches. Some important classes in this group are
.
Public Typedef Details
(void) (^NMAPlacesCategoriesCompletionBlock) (NSArray *categories, NSError
*error)
Include:
NMAKit.framework/headers/NMAPlaces.h
A typedef of a block parameter signature used with
NMAPlaces::refreshTopLevelCategoriesWithCompletion:
.
Note:
HERE iOS SDK Developer's Guide
► API reference
207
The block will be called on the main queue.
Parameters:
•
categories
if available, nil otherwise.
•
error
The error if the refresh failed, or nil if the refresh was successful.
See also:
NMAPlaces::refreshTopLevelCategoriesWithCompletion:
(void) (^NMARequestCompletionBlock) (NMARequest *request, id data, NSError
*error)
Include:
NMAKit.framework/headers/NMARequest.h
A typedef of a block parameter signature used with
The following table shows corresponding request and result types.
•
- Expected Search Results
•
- NSArray(NMAGeocodeResult)
•
- NSArray(NMAReverseGeocodeResult)
•
-
•
•
-
•
•
- NSArray(NMACategory)
Note:
The block will be called on the main queue.
Parameters:
•
request
The search request being completed.
•
data
Search results. Search result type varies according to the search request initiated. It can be nil if no results are found or an error is encountered.
•
error
HERE iOS SDK Developer's Guide
► API reference
The error if the request failed, or nil if the request was successful.
See also:
NMASearchResultType
Public Enumeration Details
NMACategoryFilterType
Include:
NMAKit.framework/headers/NMACategoryFilter.h
Defines types of categories filter.
Enumeration Members:
•
NMACategoryFilterTypeNone
No category.
•
NMACategoryFilterTypeAccommodation
The accommodation category.
•
NMACategoryFilterTypeAdministrativeAreasBuildings
The administrative-areas-buildings category.
•
NMACategoryFilterTypeEatDrink
The eat-drink category.
•
NMACategoryFilterTypeGoingOut
The going-out category.
•
NMACategoryFilterTypeLeisureOutdoor
The leisure-outdoor category.
•
NMACategoryFilterTypeNaturalGeographical
The natural-geographical category.
•
NMACategoryFilterTypeShopping
The shopping category.
•
NMACategoryFilterTypeSightsMuseums
The sights-museums category.
•
NMACategoryFilterTypeTransport
The transport category.
208
HERE iOS SDK Developer's Guide
► API reference
•
NMACategoryFilterTypePetrolStation
The petrol-station category.
•
NMACategoryFilterTypeAtmBankExchange
The atm-bank-exchange category.
•
NMACategoryFilterTypeToiletRestArea
The toilet-rest-area category.
•
NMACategoryFilterTypeHospitalHealthCareFacility
The hospital-health-care-facility category.
NMAMediaType
Include:
NMAKit.framework/headers/NMAMedia.h
derived objects.
Enumeration Members:
•
NMAMediaTypeUnknown
object unknown.
•
NMAMediaTypeEditorial
•
NMAMediaTypeImage
.
•
NMAMediaTypeReview
•
NMAMediaTypeRating
NMATextFormat
Include:
NMAKit.framework/headers/NMARequest.h
Search result text output formats.
Enumeration Members:
•
NMATextFormatHTML
The request results will be rendered as HTML.
•
NMATextFormatPlain
209
HERE iOS SDK Developer's Guide
► API reference
The request results will be rendered as plain text.
Public Variable Details
FOUNDATION_EXPORT NSString *const NMAPlacesSourceBuilding
Include:
NMAKit.framework/headers/NMAPlaces.h
Places Reference Source for building IDs.
FOUNDATION_EXPORT NSString *const NMAPlacesSourcePVID
Include:
NMAKit.framework/headers/NMAPlaces.h
Places Reference Source for core POI IDs.
FOUNDATION_EXPORT NSString *const NMAPlacesSourceSharing
Include:
NMAKit.framework/headers/NMAPlaces.h
Places Reference Source for sharing IDs.
FOUNDATION_EXPORT NSString *const NMAPlacesSourceVenuesAll
Include:
NMAKit.framework/headers/NMAPlaces.h
Places Reference Source for all types of venue IDs.
FOUNDATION_EXPORT NSString *const NMAPlacesSourceVenuesContent
Include:
NMAKit.framework/headers/NMAPlaces.h
Places Reference Source for venue content IDs.
FOUNDATION_EXPORT NSString *const NMAPlacesSourceVenuesDestination
Include:
NMAKit.framework/headers/NMAPlaces.h
Places Reference Source for venue destination IDs.
210
HERE iOS SDK Developer's Guide
► API reference
FOUNDATION_EXPORT NSString *const NMAPlacesSourceVenuesVenue
Include:
NMAKit.framework/headers/NMAPlaces.h
Places Reference Source for venue IDs.
FOUNDATION_EXPORT NSString *const NMA_PLACES_ERROR_DOMAIN
Include:
NMAKit.framework/headers/NMAResultListener.h
Defines the name for Places API error domain
NMAAddress
Class Summary
class
NMAAddress
Derived from: NSObject
Represents address information for a geographic location.
Include:
NMAKit.framework/headers/NMAAddress.h
Inheritance Diagrams
Figure 51: Public inheritance diagram for NMAAddress
[For complete information, see the section
]
See also:
211
HERE iOS SDK Developer's Guide
► API reference
Public Property Summary
Table 69: Public Property
Public Property
[readable, writable, strong]
NSString *
The city name
[readable, writable, strong]
NSString *
The country code
[readable, writable, strong]
NSString *
The country name
[readable, writable, strong]
NSString *
The county name
[readable, writable, strong]
NSString *
The district name
[readable, writable, strong]
NSString *
The floor number in a multi-story building
[readable, writable, strong]
NSString *
The NSString representation of the address formatted according to local standards
[readable, writable, strong]
NSString *
The house number
[readable, writable, strong]
NSString *
The descriptive label for the NMAAddress
[readable, writable, strong]
NSString *
The postal code
[readable, writable, strong]
NSString *
The state name
[readable, writable, strong]
NSString *
The street name
[readable, writable, strong]
NSString *
The suite number or unit name
212
HERE iOS SDK Developer's Guide
► API reference
Instance Method Summary
Table 70: Instance Method
Instance Methods
-(NSDictionary *)
Gets the NSDictionary containing all additional key-value NMAAddress data
Class Details
See also:
Public Property Details
[readable, writable, strong]
NSString * city
The city name.
[readable, writable, strong]
NSString * countryCode
The country code.
Note:
The country code defined in "ISO 3166-1 alpha-3" three letter format.
[readable, writable, strong]
NSString * countryName
The country name.
[readable, writable, strong]
NSString * county
The county name.
[readable, writable, strong]
NSString * district
The district name.
213
HERE iOS SDK Developer's Guide
► API reference
[readable, writable, strong]
NSString * floorNumber
The floor number in a multi-story building.
[readable, writable, strong]
NSString * formattedAddress
The NSString representation of the address formatted according to local standards.
[readable, writable, strong]
NSString * houseNumber
The house number.
[readable, writable, strong]
NSString * label
The descriptive label for the NMAAddress.
[readable, writable, strong]
NSString * postalCode
The postal code.
[readable, writable, strong]
NSString * state
The state name.
[readable, writable, strong]
NSString * street
The street name.
[readable, writable, strong]
NSString * suiteNumberOrName
The suite number or unit name.
214
HERE iOS SDK Developer's Guide
► API reference
Instance Method Details
-(NSDictionary *) additionalData
Gets the NSDictionary containing all additional key-value NMAAddress data.
Returns:
The NSDictionary of additional key-value data
NMACategory
Class Summary
class
NMACategory
Derived from: NSObject
Represents a category with which a NMAPlace can be associated.
Include:
NMAKit.framework/headers/NMACategory.h
Inheritance Diagrams
Figure 52: Public inheritance diagram for NMACategory
[For complete information, see the section
]
Public Property Summary
Table 71: Public Property
Public Property
[readable, strong]
Gets the URL of the category icon
[readable, strong]
Gets the display name for the category
215
HERE iOS SDK Developer's Guide
► API reference
216
Public Property
[readable, strong]
Gets the parent of this category
[readable, strong]
Gets the list of subcategories NMACategory of this category
[readable, strong]
Gets the unique identifier for the category
Class Details
Represents a category with which a
can be associated.
Categories can be used to search for places (e.g. a search that is based on a category with which certain places are associated).
Public Property Details
[readable, strong]
NSString * iconUrl
Gets the URL of the category icon.
Note:
Application can download the icon online with this URL, but it needs to use its own icon for offline.
[readable, strong]
NSString * name
Gets the display name for the category. The name is localized to the current locale of the device.
[readable, strong]
* parentCategory
Gets the parent of this category.
Note that an
might have no parent category, in which case this method would return
nil.
[readable, strong]
NSArray * subCategories
Gets the list of subcategories NMACategory of this category.
HERE iOS SDK Developer's Guide
► API reference
217
might have no subcategories, in which case this method would return empty array.
[readable, strong]
NSString * uniqueId
Gets the unique identifier for the category.
NMACategoryFilter
Class Summary
class
NMACategoryFilter
Derived from: NSObject
Represents a filter used when performing a search for popular places within a specific location
(exploring).
Include:
NMAKit.framework/headers/NMACategoryFilter.h
Inheritance Diagrams
Figure 53: Public inheritance diagram for NMACategoryFilter
[For complete information, see the section
]
Instance Method Summary
Table 72: Instance Method
Instance Methods
-(void)
Adds a NMACategoryFilterType to the NMACategoryFilter
-(void)
addCategoryFilterFromUniqueId:
Adds an NMACategory's uniqueId to the NMACategoryFilter
HERE iOS SDK Developer's Guide
► API reference
218
Instance Methods
Returns a stringified NMACategoryFilter, within which individual categories are separated by commas
Class Details
Represents a filter used when performing a search for popular places within a specific location
(exploring). The filter limits a search to specified categories.
Instance Method Details
-(void) addCategoryFilterFromType:(
categoryFilterType
Adds a NMACategoryFilterType to the
Parameters:
•
categoryFilterType
An NMACategoryFilterType filter
-(void) addCategoryFilterFromUniqueId:(NSString *) uniqueId
Adds an
Parameters:
•
uniqueId
's uniqueId
-(NSString *) toString
Returns a stringified
, within which individual categories are separated by commas.
Returns:
The stringified, comma-delimited set of categories.
HERE iOS SDK Developer's Guide
► API reference
NMACategoryGraphRequest
Class Summary
class
NMACategoryGraphRequest
Represents a request to retrieve an NSArray of NMACategory objects.
Include:
NMAKit.framework/headers/NMACategoryGraphRequest.h
Inheritance Diagrams
Figure 54: Public inheritance diagram for NMACategoryGraphRequest
[For complete information, see the section
]
Class Details
Represents a request to retrieve an NSArray of
NMAContactDetail
Class Summary
class
NMAContactDetail
Derived from: NSObject
Represents detailed information about a contact for a NMAPlace.
Include:
NMAKit.framework/headers/NMAContactDetail.h
219
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 55: Public inheritance diagram for NMAContactDetail
220
[For complete information, see the section
]
Public Property Summary
Table 73: Public Property
Public Property
[readable, strong]
The localized label describing the mechanism by which application end users can contact the place
[readable, strong]
The type (email, fax, phone, website, etc
[readable, strong]
The string value appropriate to the localized label
Class Details
Represents detailed information about a contact for a
For example, if a
has among its known contacts array the phone number 555-1234, use this interface to access details about that particular contact's label ("Phone") and value ("555-1234").
Public Property Details
[readable, strong]
NSString * label
The localized label describing the mechanism by which application end users can contact the place.
[readable, strong]
NSString * type
The type (email, fax, phone, website, etc.) of the
HERE iOS SDK Developer's Guide
► API reference
[readable, strong]
NSString * value
The string value appropriate to the localized label.
NMADiscoveryLink
Class Summary
class
NMADiscoveryLink
Represents a discovery search results link that can be used to perform another discovery search.
Include:
NMAKit.framework/headers/NMADiscoveryLink.h
Inheritance Diagrams
Figure 56: Public inheritance diagram for NMADiscoveryLink
221
[For complete information, see the section
]
Instance Method Summary
Table 74: Instance Method
Instance Methods
-(
Creates an NMADiscoveryRequest object to perform another NMADiscoveryPage request
Class Details
Represents a discovery search results link that can be used to perform another discovery search.
HERE iOS SDK Developer's Guide
► API reference
Instance Method Details
-(
Creates an
request.
Note:
Attempts to read this property could return nil.
Returns:
The
NMADiscoveryPage
Class Summary
class
NMADiscoveryPage
Derived from: NSObject
Represents the paginated result of a NMADiscoveryRequest request.
Include:
NMAKit.framework/headers/NMADiscoveryPage.h
Inheritance Diagrams
Figure 57: Public inheritance diagram for NMADiscoveryPage
222
[For complete information, see the section
]
Public Property Summary
Table 75: Public Property
Public Property
[readable, assign]
The total number of available NMAPlaceLink or NMADiscoveryLink objects for this discovery page
HERE iOS SDK Developer's Guide
► API reference
223
Public Property
[readable, strong]
Array of NMAPlaceLink or NMADiscoveryLink objects for the current page of results
[readable, strong]
*
The NMADiscoveryRequest for requesting the next page of results
[readable, assign]
Result offset of the current results page into the total number of results avilable
Class Details
Represents the paginated result of a
request.
objects are typically created using the
interface to initialize search, explore or here requests.
Results may be split into multiple page. Each results page contains a collection of
and
objects, each of which represents either an actual place or a further discovery request.
Public Property Details
[readable, assign]
NSInteger available
The total number of available
or
objects for this discovery page.
[readable, strong]
NSArray * discoveryResults
Array of
objects for the current page of results.
Note:
The discoveryResults may contain more results than the maximum number specified in
. These extra results link to different resources and contain
further links via which the user will be linked to a place.
[readable, strong]
* nextPageRequest
The
for requesting the next page of results.
Note:
This will be nil if there is no next page.
HERE iOS SDK Developer's Guide
► API reference
[readable, assign]
NSInteger offsetCount
Result offset of the current results page into the total number of results avilable.
Note:
The number of results on the current page is the number of elements in
NMADiscoveryRequest
Class Summary
class
NMADiscoveryRequest
Represents a request to retrieve an NMADiscoveryPage object.
Include:
NMAKit.framework/headers/NMADiscoveryRequest.h
Inheritance Diagrams
Figure 58: Public inheritance diagram for NMADiscoveryRequest
224
[For complete information, see the section
]
Public Property Summary
Table 76: Public Property
Public Property
[readable, writable, assign]
The text format of the request results
HERE iOS SDK Developer's Guide
► API reference
225
Class Details
Represents a request to retrieve an
Public Property Details
[readable, writable, assign]
textFormat
The text format of the request results.
Note:
The default value is NMATextFormatHTML.
NMAExtendedAttribute
Class Summary
class
NMAExtendedAttribute
Derived from: NSObject
Represents additional detailed information about a
, an extensible collection of attributes
that can include:
Include:
NMAKit.framework/headers/NMAExtendedAttribute.h
Inheritance Diagrams
Figure 59: Public inheritance diagram for NMAExtendedAttribute
[For complete information, see the section
]
Public Property Summary
Table 77: Public Property
Public Property
[readable, strong]
HERE iOS SDK Developer's Guide
► API reference
226
Public Property
The localized display label for the extended attribute, e.g. "Payment", which can be displayed directly by the client application.
[readable, strong]
The localized text for the extended attribute as NSString, e.g. "VISA", which can be can be displayed directly by the client application.
[readable, strong]
Gets the unique identifier for the NMAExtendedAttribute.
Class Details
Represents additional detailed information about a
, an extensible collection of attributes
that can include:
• Payment - a list of available payment methods (such as cash, credit card, or direct debit, etc)
• OpeningHours - a list of hours during which the place is open for business
• AnnualClosings - a description of annual closing dates such as holidays or other special occasions
• Price - a price list
• NearestLandmark - a description of the nearest landmark
• LanguagesSpoken - a list of the languages that are spoken at the place
• AvailableParking - a list of parking options available nearby
• Smoking - a notification of whether smoking is allowed
• DisabledAccess - a notification of whether disabled access is available
Public Property Details
[readable, strong]
NSString * label
The localized display label for the extended attribute, e.g. "Payment", which can be displayed directly by the client application.
[readable, strong]
NSString * text
The localized text for the extended attribute as NSString, e.g. "VISA", which can be can be displayed directly by the client application.
If the text represents a list of items, the items are separated by a line break entity (<br/> if the text format is HTML-encoded or newline if the text format is plain).
HERE iOS SDK Developer's Guide
► API reference
[readable, strong]
NSString * uniqueId
Gets the unique identifier for the NMAExtendedAttribute.
Note:
See the list of attributes in the class description.
NMAGeocodeRequest
Class Summary
class
NMAGeocodeRequest
Represents a request to retrieve NMAPlaceLocation data by way of NMAGeocoder search services.
Include:
NMAKit.framework/headers/NMAGeocodeRequest.h
Inheritance Diagrams
Figure 60: Public inheritance diagram for NMAGeocodeRequest
227
[For complete information, see the section
]
Public Property Summary
Table 78: Public Property
Public Property
[readable, writable, assign]
Deprecated: This method is deprecated as of NMA SDK 3.1. As this type of search no longer support this.
The text format of the request results
HERE iOS SDK Developer's Guide
► API reference
228
Class Details
Represents a request to retrieve
search services.
Note:
A NMAGeocodeRequest is a kind of
, and its response is an instance of
.
Public Property Details
[readable, writable, assign]
textFormat
Deprecated: This method is deprecated as of NMA SDK 3.1. As this type of search no longer support this.
The text format of the request results.
NMAGeocodeResult
Class Summary
class
NMAGeocodeResult
Derived from: NSObject
Represents the result of a geocode request.
Include:
NMAKit.framework/headers/NMAGeocodeResult.h
Inheritance Diagrams
Figure 61: Public inheritance diagram for NMAGeocodeResult
[For complete information, see the section
]
See also:
HERE iOS SDK Developer's Guide
► API reference
229
Public Property Summary
Table 79: Public Property
Public Property
[readable, assign]
The location data of the geocode result.
[readable, assign]
Details about the quality of the result.
[readable, assign]
The relevance of the result location to the original search parameters.
Class Details
Represents the result of a geocode request.
The data of a geocode result is represented by an instance of
the location property. The quality of the result can be assessed in a broad sense with the relevance property, or in more detail using the matchQuality dictionary.
See also:
Public Property Details
[readable, assign]
* location
The location data of the geocode result.
[readable, assign]
NSDictionary * matchQuality
Details about the quality of the result.
Additional information about the accuracy of the result is available in the matchQuality dictionary. It contains one or more NSNumber values representing how well each individual search parameter was matched. The values will be in the range [0, 1] with a value of 1 indicating a perfect match.
The possible keys are "State", "County", "City", "District", "Street", "SecondaryStreet",
"HouseNumber", and "PostalCode".
Note:
HERE iOS SDK Developer's Guide
► API reference
230
The "SecondaryStreet" key will be present if an intersection was specified in the geocode request. For example, if the request contained "1st St at 2nd Ave", the "Street" key would access the match value for "1st St" and the "SecondaryStreet" key would access the match value for "2nd Ave".
[readable, assign] float relevance
The relevance of the result location to the original search parameters.
The relevance of a result provides a measure of how accurate or reliable it is. The valid range is [0, 1], with a value of 1 representing a perfect match. If relevancy data is unavailable (such as for an offline search), this property will have the value NMAGeocodeResultInvalidRelevance.
NMAGeocoder
Class Summary
class
NMAGeocoder
Derived from: NSObject
Represents a factory used to instantiate geocoder requests.
Include:
NMAKit.framework/headers/NMAGeocoder.h
Inheritance Diagrams
Figure 62: Public inheritance diagram for NMAGeocoder
[For complete information, see the section
]
HERE iOS SDK Developer's Guide
► API reference
Instance Method Summary
Table 80: Instance Method
Instance Methods
-(
createGeocodeRequestWithQuery:
(NSString *) query searchArea:(
*) searchArea locationContext:(
*) geoCoordinates
Creates a geocoder request that resolves a free text query into an array of NMAPlaceLocation
-(
createReverseGeocodeRequestWithGeoCoordinates:
*) geoCoordinates
Creates a reverse geocoder request that resolves a NMAGeoCoordinates context into a NMAPlaceLocation
Class Method Summary
Table 81: Class Method
Class Methods
+(
Returns the NMAGeocoder singleton instance
Class Details
Represents a factory used to instantiate geocoder requests.
A NMAGeocoder enables searching for location data by way of the following search services:
• One box Geocode - matches a free text query (and location context) to its correct
on the map (its latitude and longitude).
• Reverse Geocode - retrieves a
Note:
requires valid authentication credentials to be set via
If valid credentials are not present an attempt to call sharedNMAGeocoder will result in a runtime assert.
Instance Method Details
-(
*) createGeocodeRequestWithQuery:(NSString *)
query searchArea:(
*) searchArea locationContext:(
231
HERE iOS SDK Developer's Guide
► API reference
232
Creates a geocoder request that resolves a free text query into an array of
. After creating the request, [request startWithListener:(id<NMAResultListener>)] needs to be called to start the search.
Parameters:
•
query
Query text specifying the search item to locate
•
searchArea
representing the search area (this is an optional parameter and should not be set unless such functionality is explicitly intended in the application)
•
geoCoordinates
object representing the location context used to search for results that are
appropriate to the query parameter
Returns:
The
-(
createReverseGeocodeRequestWithGeoCoordinates:(
geoCoordinates
Creates a reverse geocoder request that resolves a
context into a
. After creating the request, [request startWithListener:(id<NMAResultListener>)] needs to be called to start the search.
Parameters:
•
geoCoordinates
A query
context
Returns:
The
Class Method Details
+(
Returns the NMAGeocoder singleton instance.
HERE iOS SDK Developer's Guide
► API reference
Note:
Use this method to obtain a NMAGeocoder instance. Do not call init directly.
Returns:
shared NMAGeocoder instance
NMALink
Class Summary
class
NMALink
Derived from: NSObject
Represents a HERE Places resource link which requires another request to be made in order to retrieve the full detauls of the resource.
Include:
NMAKit.framework/headers/NMALink.h
Inheritance Diagrams
Figure 63: Public inheritance diagram for NMALink
233
[For complete information, see the section
]
Public Property Summary
Table 82: Public Property
Public Property
[readable, strong]
Gets an URL of the icon for the resource to which assiciated with this NMALink
[readable, strong]
HERE iOS SDK Developer's Guide
► API reference
234
Public Property
Gets the localized name for the resource to which the NMALink refers
[readable, strong]
Gets the unique identifier for the resource to which the NMALink refers
[readable, strong]
Gets the NSString representation of the link URL
Class Details
Represents a HERE Places resource link which requires another request to be made in order to retrieve the full detauls of the resource. The link contains basic metadata about the linked resource.
The interface is typically subclassed to provide methods to make the appropriate resource request.
Public Property Details
[readable, strong]
NSString * iconUrl
Gets an URL of the icon for the resource to which assiciated with this
Note:
object is optional, so this property could be nil. Application can download the icon online with this URL, but it needs to use its own icon for offline.
[readable, strong]
NSString * name
Gets the localized name for the resource to which the NMALink refers.
Client applications can safely display this name to the user.
Note:
A title for a linked object is optional, so this property could be nil.
[readable, strong]
NSString * uniqueId
Gets the unique identifier for the resource to which the NMALink refers.
Note:
An identifier for a linked object is optional, so this property could be nil.
HERE iOS SDK Developer's Guide
► API reference
235
[readable, strong]
NSString * url
Gets the NSString representation of the link URL.
This URL may be used to perform an HTTP GET request to the HERE Places REST service to retrieve the full metadata of the linked resources.
The request may return a HTML or JSON response. If url contains "places.hybrid.api.here.com", it will return a JSON response as specified at http://developer.here.com/places If URL contains other domains, it will most likely return a HTML response.
Note:
For convenience it is recommended to use request methods in dervied classes when available.
NMAMedia
Class Summary
class
NMAMedia
Derived from: NSObject
Represents the base interface for additional rich content about a
.
Include:
NMAKit.framework/headers/NMAMedia.h
Inheritance Diagrams
Figure 64: Public inheritance diagram for NMAMedia
[For complete information, see the section
]
HERE iOS SDK Developer's Guide
► API reference
236
Public Property Summary
Table 83: Public Property
Public Property
[readable, strong]
The NSString representation of the attribution text for the NMAMedia, according to the terms and conditions of the originating source
[readable, strong]
The NMALink to the resource representing the supplier of the content (the object provides details on the origin of the information)
[readable, assign]
The specialized content type
[readable, strong]
The NMALink to the origin of the information, usually a website of the supplier
Class Details
Represents the base interface for additional rich content about a
.
The following specialized content might be available:
• images
• editorials
• reviews
Public Property Details
[readable, strong]
NSString * attributionText
The NSString representation of the attribution text for the NMAMedia, according to the terms and conditions of the originating source.
[readable, strong]
* supplierLink
The NMALink to the resource representing the supplier of the content (the object provides details on the origin of the information).
HERE iOS SDK Developer's Guide
► API reference
[readable, assign]
type
The specialized content type.
[readable, strong]
* viaLink
The NMALink to the origin of the information, usually a website of the supplier. The type attribute of the link might need to be checked to see if there is a better user agent than a web browser for handling the media type of the linked-to resource.
NMAMediaCollectionPage
Class Summary
class
NMAMediaCollectionPage
Derived from: NSObject
Represents a paginated collection of NMAMedia objects of a specific type.
Include:
NMAKit.framework/headers/NMAMediaCollectionPage.h
Inheritance Diagrams
Figure 65: Public inheritance diagram for NMAMediaCollectionPage
237
[For complete information, see the section
]
See also:
HERE iOS SDK Developer's Guide
► API reference
Public Property Summary
Table 84: Public Property
Public Property
[readable, assign]
The total number of available NMAMedia objects in this given media collection
[readable, strong]
[readable, strong]
*
The NMAMediaCollectionPageRequest for requesting the next page of the NMAMediaCollectionPage
[readable, assign]
The offset count for the current page of the completed NMAMediaCollectionPageRequest
[readable, assign]
The specialized content type of the objects on the page
Class Details
Represents a paginated collection of
objects of a specific type.
Note:
Each collection contains objects of a single NMAMediaType
See also:
Public Property Details
[readable, assign]
NSInteger available
The total number of available
objects in this given media collection.
[readable, strong]
NSArray * mediaContents
Array of
objects for the current page
[readable, strong]
* nextPageRequest
238
HERE iOS SDK Developer's Guide
► API reference
239
The
for requesting the next page of the
Note:
This will be nil if no more pages are available.
[readable, assign]
NSInteger offsetCount
The offset count for the current page of the completed
[readable, assign]
type
The specialized content type of the objects on the page.
NMAMediaCollectionPageRequest
Class Summary
class
NMAMediaCollectionPageRequest
Represents a request to retrieve an NMAMediaCollectionPage object.
Include:
NMAKit.framework/headers/NMAMediaCollectionPageRequest.h
Inheritance Diagrams
Figure 66: Public inheritance diagram for NMAMediaCollectionPageRequest
[For complete information, see the section
]
Class Details
Represents a request to retrieve an
object.
HERE iOS SDK Developer's Guide
► API reference
NMAMediaEditorial
Class Summary
class
NMAMediaEditorial
Represents editorial content about a NMAPlace.
Include:
NMAKit.framework/headers/NMAMediaEditorial.h
Inheritance Diagrams
Figure 67: Public inheritance diagram for NMAMediaEditorial
[For complete information, see the section
]
See also:
Public Property Summary
Table 85: Public Property
Public Property
[readable, strong]
The NSString for this editorial content
[readable, strong]
The BCP-47 language code for the editorial text
240
HERE iOS SDK Developer's Guide
► API reference
Class Details
Represents editorial content about a
See also:
Public Property Details
[readable, strong]
NSString * description
The NSString for this editorial content.
[readable, strong]
NSString * languageCode
The BCP-47 language code for the editorial text.
Note:
A language code for an editorial is optional and so attempts to read this property could return empty string. In this scenario the language of editorial is unknown but it is likely to be English.
NMAMediaImage
Class Summary
class
NMAMediaImage
Represents an image associated with an NMAPlace.
Include:
NMAKit.framework/headers/NMAMediaImage.h
241
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 68: Public inheritance diagram for NMAMediaImage
[For complete information, see the section
]
See also:
Public Property Summary
Table 86: Public Property
Public Property
[readable, strong]
The external URL of the image source
[readable, strong]
The unique identifier of the image
[readable, strong]
The details of the user who contributed the image
Instance Method Summary
Table 87: Instance Method
Instance Methods
(NSInteger) width height:(NSInteger) height
Gets a URL for an image with specific width-height dimensions
242
HERE iOS SDK Developer's Guide
► API reference
243
Class Details
Represents an image associated with an
. Images are uploaded by the HERE user
community.
See also:
Public Property Details
[readable, strong]
NSString * imageSource
The external URL of the image source.
[readable, strong]
NSString * uniqueId
The unique identifier of the image.
Note:
An ID for an image is optional. Attempts to read this property could return empty string.
[readable, strong]
* user
The details of the user who contributed the image.
Note:
A user-contributor for an image is optional. Attempts to read this property could return nil.
Instance Method Details
-(NSString *) URLForImageWithWidth:(NSInteger) width height:(NSInteger)
height
Gets a URL for an image with specific width-height dimensions.
The provided width-height are used as upper boundaries for the dimensions of the returned images.
The solution will never scale up small images and will maintain the aspect ratio of the original image.
HERE iOS SDK Developer's Guide
► API reference
244
A URL of image with specific width-height dimensions will not be returned if it has not been queried with NMARequest:addImageSizeWithWidth:height
For example: image_dimensions=w32-h32,w64-h64 image_dimensions=w32-h32,w300 image_dimensions=h200
Parameters:
•
width
The image width.
•
height
The image height.
Returns:
The URL to retrieve the image with the specified width-height dimensions. Can be nil if an image with the specified dimensions is unavailable.
NMAMediaRating
Class Summary
class
NMAMediaRating
Represents rating content about a NMAPlace.
Include:
NMAKit.framework/headers/NMAMediaRating.h
Inheritance Diagrams
Figure 69: Public inheritance diagram for NMAMediaRating
[For complete information, see the section
]
HERE iOS SDK Developer's Guide
► API reference
See also:
Public Property Summary
Table 88: Public Property
Public Property
[readable, assign]
The average rating for this NMAPlace
[readable, assign]
The number of individual votes that users provide for rating this NMAPlace
Class Details
Represents rating content about a
See also:
Public Property Details
[readable, assign] double average
.
[readable, assign]
NSUInteger count
The number of individual votes that users provide for rating this
245
HERE iOS SDK Developer's Guide
► API reference
NMAMediaReview
Class Summary
class
NMAMediaReview
Represents review content that provides access to user reviews and ratings about a NMAPlace.
Include:
NMAKit.framework/headers/NMAMediaReview.h
Inheritance Diagrams
Figure 70: Public inheritance diagram for NMAMediaReview
246
[For complete information, see the section
]
See also:
NMAMediaRatings
Public Property Summary
Table 89: Public Property
Public Property
[readable, strong]
The NSDate specifying the date when the user contributed the review
[readable, strong]
Details of the user who contributed the review
[readable, strong]
The review content for the NMAPlace
HERE iOS SDK Developer's Guide
► API reference
Public Property
[readable, strong]
The BCP-47 language code in which the review is available
[readable, assign]
The rating that the review contributor gave for the place
[readable, strong]
The title of the review that the user contributed
Class Details
Represents review content that provides access to user reviews and ratings about a
.
See also:
NMAMediaRatings
Public Property Details
[readable, strong]
NSDate * contributionDate
The NSDate specifying the date when the user contributed the review.
[readable, strong]
* contributor
Details of the user who contributed the review.
Note:
The contributor may be unkown. Attempts to read this property could return nil.
[readable, strong]
NSString * description
.
Note:
Depending on the NMASupplier, the full content might not be displayed and the full review might be available only within the resource to which the optional via
attribute links.
247
HERE iOS SDK Developer's Guide
► API reference
[readable, strong]
NSString * languageCode
The BCP-47 language code in which the review is available.
Note:
Attempts to read this property could return empty string as the language code for a review is optional. If nil the
language is unkown but is likely to be English.
[readable, assign] double rating
The rating that the review contributor gave for the place.
Note:
The rating may come from various systems with different rating schemes. The value of this attribute may not reflect the rating scheme of the supplier's service, but is adjusted to the value range of the Places API [1..5].
[readable, strong]
NSString * title
The title of the review that the user contributed.
Note:
A title for a review is optional. Attempts to read this property could return empty string.
NMAPlace
Class Summary
class
NMAPlace
Derived from: NSObject
Represents a set of data about a physical place.
Include:
NMAKit.framework/headers/NMAPlace.h
248
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 71: Public inheritance diagram for NMAPlace
[For complete information, see the section
]
Public Property Summary
Table 90: Public Property
Public Property
[readable, strong]
[readable, strong]
The string containing the attribution string for this NMAPlace
[readable, strong]
The NSArray of NMACategory objects linking to categories that have been assigned to the NMAPlace
[readable, strong]
Array of NMAContactDetail objects that provide information on how to contact the place
[readable, strong]
NMAMediaCollectionPage of NMAMediaEditorial objects
[readable, assign]
NSArray of NMAExtendedAttribute objects representing additional information about an NMAPlace
[readable, strong]
An URL of icon that represents the NMAPlace
[readable, strong]
NMAMediaCollectionPage of NMAMediaImage objects
[readable, strong]
The NMAPlaceLocation of the NMAPlace
[readable, strong]
[readable, strong]
249
HERE iOS SDK Developer's Guide
► API reference
Public Property
NMAMediaCollectionPage of NMAMediaRating objects
[readable, assign]
The NSDictionary of related places (where available) that might also interest an application user
[readable, strong]
Gets the link for getting options for reporting a place because, for example, it contains inappropriate content or the place does not exist
[readable, strong]
NMAMediaCollectionPage of NMAMediaReview objects
[readable, strong]
[readable, strong]
[readable, strong]
The user ratings for the NMAPlace
[readable, strong]
URL to an external web page that represents the NMAPlace
Instance Method Summary
Table 91: Instance Method
Instance Methods
-(NSArray *)
referenceIdentifiersForSource:
Get reference identifiers for a specific source
Class Details
Represents a set of data about a physical place.
A NMAPlace acts as a container for various information about a place, which itself is a point of interest such as a popular restaurant, a park, or someone's home.
Note:
A
can contain attributes, collections of media about the place, and key-value pairs
of related places.
250
HERE iOS SDK Developer's Guide
► API reference
251
Public Property Details
[readable, strong]
NSDictionary * alternativeNames
Gets the NSDictionary for the alternative names of
in a list of mapping languages and alternative names
Note:
An alternative name for a place is optional. Attempts to read this property could return nil.
[readable, strong]
NSString * attributionText
The string containing the attribution string for this
.
example : Provided by <a href=" http://originalArticle.. .">Qype user <a href=" http:// userProfile.. .">Max Mustermann
Note:
Attribution text for a place is optional. Attempts to read this property could return nil.
[readable, strong]
NSArray * categories
The NSArray of
objects linking to categories that have been assigned to the
Note:
A
object extends the standard link object with an optional icon link pointing to an icon appropriate for that category. Categories for a place is optional. Attempts to read this property could return nil.
[readable, strong]
NSArray * contacts
Array of
objects that provide information on how to contact the place.
Note:
Contact information for a place is optional. Attempts to read this property could return nil.
[readable, strong]
* editorials
NMAMediaCollectionPage::mediaContents
.
HERE iOS SDK Developer's Guide
► API reference
252
Note:
Editorial content for a place is optional. Attempts to read this property could return nil.
[readable, assign]
NSArray * extendedAttributes
NSArray of
objects representing additional information about an
An extensible collection of attributes can include:
•
• openingHours -
•
•
•
• languagesSpoken -
• availableParking -
• smoking -
•
Note:
Extended attribute for a place is optional. Attempts to read this property could return nil.
[readable, strong]
NSString * iconUrl
An URL of icon that represents the
Note:
Application can download the icon online with this URL, but it needs to use its own icon for offline.
[readable, strong]
* images
objects. See also
NMAMediaCollectionPage::mediaContents
.
Note:
Image content for a place is optional. Attempts to read this property could return nil.
HERE iOS SDK Developer's Guide
► API reference
253
[readable, strong]
* location
The
.
[readable, strong]
NSString * name
and localized to language preference defined in
Note:
Attempts to read this property could return an empty string.
[readable, strong]
* ratings
NMAMediaCollectionPage::mediaContents
.
Note:
Rating content for a place is optional. Attempts to read this property could return nil.
[readable, assign]
NSDictionary * related
The NSDictionary of related places (where available) that might also interest an application user.
The NSDictionary is keyed by a localized title to language preference defined in
(if possible) of the related places (for example, "Nearby", "public-transport"), while the associated value
is a link presented in class derived from
Note:
Atempts to read this property could return nil.
[readable, strong]
* reportingLink
Gets the link for getting options for reporting a place because, for example, it contains inappropriate content or the place does not exist.
Note:
A reporting link for a place is optional. Attempts to read this property could return nil.
[readable, strong]
* reviews
HERE iOS SDK Developer's Guide
► API reference
NMAMediaCollectionPage::mediaContents
.
Note:
Review content for a place is optional. Attempts to read this property could return nil.
[readable, strong]
* supplier
.
The supplier link extends the standard link object with an optional icon link that points to the supplier's brand icon.
Example:
"name": "Qype",
"url": "http://...",
"icon": "http://..."
Note:
A supplier link for a place is optional. Attempts to read this property could return nil.
[readable, strong]
NSString * uniqueId
Unique consistent identifier for the place represented by this
instance
Note:
The identifier value is consistent across application sessions. Applications that want to keep a reference to a specific place can store this identifier for subsequent linking to additional resources.
[readable, strong]
* userRatings
The user ratings for the
Note:
User ratings for a place are optional. Attempts to read this property could return nil.
[readable, strong]
NSString * viewUrl
URL to an external web page that represents the
254
HERE iOS SDK Developer's Guide
► API reference
255
Note:
Applications are encouraged to provide web links to places they display information about.
Atempts to read this property could return an empty string.
Instance Method Details
-(NSArray *) referenceIdentifiersForSource:(NSString *) source
Get reference identifiers for a specific source. For example, a place can have a reference to an extruded building object in the map. The reference identifiers can be retrieved by calling this method with source NMAPlacesSourceBuilding.
Index 0 is the primary reference identifier for the place.
Note:
A reference identifier will not be returned if it has not been queried with the
Parameters:
•
source
NSString specifying the source
Returns:
An NSArray of reference identifiers. Return nil if reference identifier does not exist.
NMAPlaceLink
Class Summary
class
NMAPlaceLink
Represents metadata about a place, this object is usually returned as a response to places search.
Include:
NMAKit.framework/headers/NMAPlaceLink.h
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 72: Public inheritance diagram for NMAPlaceLink
[For complete information, see the section
]
Public Property Summary
Table 92: Public Property
Public Property
[readable, assign]
The average rating for the NMAPlace if available, otherwise -1
[readable, strong]
The enclosing NMAGeoBoundingBox describing a range of coordinates that correspond to the NMAPlace
[readable, strong]
The NMACategory to the primary category for the NMAPlace
[readable, assign]
The distance to the NMAPlace, in meters
[readable, assign]
Indicates whether this search result is sponsored
[readable, strong]
The NMAGeoCoordinates representing the geographical position of the NMAPlace
[readable, strong]
The NSString description of the vicinity surrounding the NMAPlaceLink
256
HERE iOS SDK Developer's Guide
► API reference
257
Instance Method Summary
Table 93: Instance Method
Instance Methods
-(
Gets the request to retrieve the NMAPlace details
-(NSArray *)
referenceIdentifiersForSource:
Get reference identifiers for a specific source. For example, a place can have a reference to an extruded building object in the map. The reference identifiers can be retrieved by calling this method with source NMAPlacesSourceBuilding.
Class Details
Represents metadata about a place, this object is usually returned as a response to places search.
Note:
Public Property Details
[readable, assign] double averageRating
The average rating for the
if available, otherwise -1.0 to indicate the value is not available.
[readable, strong]
* boundingBox
The enclosing NMAGeoBoundingBox describing a range of coordinates that correspond to the
. Typically, bounding boxes are associated with places such as cities and countries.
Note:
Bounding box information for a place is optional. Attempts to read this property could return nil.
[readable, strong]
* category
The NMACategory to the primary category for the
.
[readable, assign]
NSInteger distance
HERE iOS SDK Developer's Guide
► API reference
258
The distance to the
Note:
Distance information for a place is optional. Attempts to read this property could return be zero.
[readable, assign]
BOOL isSponsored
Indicates whether this search result is sponsored.
Applications should provide some visual differentiation between sponsored search results and regular search results.
Note:
Sponsorship is an optional attribute for a place.
[readable, strong]
* position
The NMAGeoCoordinates representing the geographical position of the
[readable, strong]
NSString * vicinityDescription
The NSString description of the vicinity surrounding the
.
Typically, this property is derived from the address, but could also contain any other description that helps an application user understand where the place is located.
Instance Method Details
-(
Gets the request to retrieve the
details. Attempts to read this property could return nil.
-(NSArray *) referenceIdentifiersForSource:(NSString *) source
Get reference identifiers for a specific source. For example, a place can have a reference to an extruded building object in the map. The reference identifiers can be retrieved by calling this method with source NMAPlacesSourceBuilding.
Index 0 is the primary reference identifier for the place.
HERE iOS SDK Developer's Guide
► API reference
Note:
A reference identifier will not be returned if it has not been queried with the
Parameters:
•
source
NSString specifying the source
Returns:
An NSArray of reference identifiers. Return nil if reference identifier does not exist.
NMAPlaceLocation
Class Summary
class
NMAPlaceLocation
Derived from: NSObject
Represents a location on a map in terms of a street address and a geographical position.
Include:
NMAKit.framework/headers/NMAPlaceLocation.h
Inheritance Diagrams
Figure 73: Public inheritance diagram for NMAPlaceLocation
259
[For complete information, see the section
]
Public Property Summary
Table 94: Public Property
Public Property
[readable, writable, strong]
The NMAAddress for the NMAPlaceLocation
HERE iOS SDK Developer's Guide
► API reference
Public Property
[readable, writable, strong]
The bounding box of the place location if available
[readable, writable, strong]
NSString *
The descriptive label for the NMAPlaceLocation
[readable, writable, strong]
NSString *
The unique ID of the place location
[readable, writable, strong]
NMAGeoCoordinates for the NMAPlaceLocation if available
Instance Method Summary
Table 95: Instance Method
Instance Methods
-(NSArray *)
referenceIdentifiersForSource:
Get reference identifiers for a specific source
Class Details
Represents a location on a map in terms of a street address and a geographical position.
Public Property Details
[readable, writable, strong]
The
.
[readable, writable, strong]
The bounding box of the place location if available.
[readable, writable, strong]
NSString * label
260
HERE iOS SDK Developer's Guide
► API reference
261
[readable, writable, strong]
NSString * locationId
The unique ID of the place location.
[readable, writable, strong]
for the
if available.
Instance Method Details
-(NSArray *) referenceIdentifiersForSource:(NSString *) source
Get reference identifiers for a specific source. For example, a place can have a reference to an extruded building object in the map. The reference identifiers can be retrieved by calling this method with source NMAPlacesSourceBuilding.
Index 0 is the primary reference identifier for the place.
Note:
A reference identifier will not be returned if it has not been queried with the (see
Parameters:
•
source
NSString specifying the source.
Returns:
An NSArray of reference identifiers. Return nil if reference identifier does not exist.
NMAPlaceRequest
Class Summary
class
NMAPlaceRequest
Represents a request to retrieve an NMAPlace object.
Include:
NMAKit.framework/headers/NMAPlaceRequest.h
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 74: Public inheritance diagram for NMAPlaceRequest
[For complete information, see the section
]
Public Property Summary
Table 96: Public Property
Public Property
[readable, writable, assign]
The text format of the request results
Instance Method Summary
Table 97: Instance Method
Instance Methods
-(void)
(NSInteger) width height:(NSInteger) height
To request an image media with specific width-height dimensions
Class Details
Represents a request to retrieve an
object.
Public Property Details
[readable, writable, assign]
textFormat
The text format of the request results.
Note:
The default value is NMATextFormatHTML.
262
HERE iOS SDK Developer's Guide
► API reference
263
Instance Method Details
-(void) addImageSizeWithWidth:(NSInteger) width height:(NSInteger) height
To request an image media with specific width-height dimensions. At least one of the sizes (width or height) needs to be valid (greater than 0).
Note taht the provided width-height are used as upper boundaries for the dimensions of the returned images.
For example: image_dimensions=w32-h32,w64-h64 image_dimensions=w32-h32,w300 image_dimensions=h200
Parameters:
•
width
The image width.
•
height
The image height.
NMAPlaces
Class Summary
class
NMAPlaces
Derived from: NSObject
Represents a factory for creating places requests.
Include:
NMAKit.framework/headers/NMAPlaces.h
Inheritance Diagrams
Figure 75: Public inheritance diagram for NMAPlaces
HERE iOS SDK Developer's Guide
► API reference
264
[For complete information, see the section
]
Instance Method Summary
Table 98: Instance Method
Instance Methods
-(
createExploreRequestWithLocation:
searchArea:(
Creates a NMAPlaces explore request using a specified location context and category filter
-(
createHereRequestWithLocation:
(
*) location
*) filters
Creates a NMAPlaces "What's here?" request using a specified location context and category filter
-(
createLookupRequestWithReferenceIdentifier:
(NSString *) referenceIdentifier inSource:(NSString *) source
Creates a NMAPlaceRequest based on a reference identifier and source
-(
createSearchRequestWithLocation:
query:(NSString *) query
Creates a NMAPlaces search request using a specified location and query
-(
createSuggestionRequestWithLocation:
location partialTerm:(NSString *) partialTerm
Creates a NMAPlaces request to return a list of suggested search terms that are related to a specified location context and partial search term
-(void)
refreshTopLevelCategoriesWithCompletion:
NMAPlacesCategoriesCompletionBlock
) completionBlock
Refresh the localized top level categories for Places Search
-(NSArray *)
Return the localized top level categories for Places Search
Class Method Summary
Table 99: Class Method
Class Methods
+(
HERE iOS SDK Developer's Guide
► API reference
265
Class Methods
Returns the NMAPlaces singleton instance
Class Details
Represents a factory for creating places requests.
The NMAPlaces service supports a variety of use cases that center around two major features:
• Place discovery - helps users find places that are relevant to them.
• Place information retrieval - provides detailed information about places in which users are interested.
For place discovery, the NMAPlaces API supports two use cases from which to choose according to the requirements for the application:
• Search - finds places that match user-provided search terms.
• Explore - guides users to relevant places nearby.
The NMAPlaces API defines resources that represent entry points for supported use cases, employing links to describe the application flow within a particular use case.
For example, the discovery request is an entry point to the NMAPlaces API resource. When an application user submits a discovery request to the search resource, the response contains, among other items, a list of links to places or to place resources. Each referenced place might have rich content associated with it, including ratings, images, reviews, editorials, and owner content. Each place also contains references to related places, which allow users to discover places relevant to or otherwise related to their original search.
Note:
requires valid authentication credentials to be set via
. If valid credentials are not present the API may not function correctly or may stop functioning correctly in the future when server side configurations change.
Instance Method Details
-(
*) createExploreRequestWithLocation:(
filters:(
Creates a NMAPlaces explore request using a specified location context and category filter. If a category filter is provided, the created request will limit results to include only items with categories specified in the filter.
HERE iOS SDK Developer's Guide
► API reference
266
The results of the explore request is a list of nearby relevant places for a given positon. It answers the question "What interesting places are near a location?" The results returned are confined to those located in the current search area and are ordered by popularity.
Note:
In addition to the requested location this search also considers the current device position as
.
Parameters:
•
location
A NMAGeoCoordinates representing the location context used to search for nearby places
•
geoArea
A NMAGeoBoundingBox representing the query's search area (this is an optional parameter and should not be set unless such functionality is explicitly intended in the application)
•
filters
A NMACategoryFilter representing the category filter
Returns:
The NMADiscoveryRequest if parameters are valid
-(
*) createHereRequestWithLocation:(
*) location filters:(
Creates a NMAPlaces "What's here?" request using a specified location context and category filter. If a category filter is provided, the created request will limit results to include only items with categories specified in the filter.
The results of the here request is a list of places with addresses that lie within the vicinity of the search location. The feature is typically used by applications that include "check-in" or "click on map to get more information" options.
Note:
In addition to the requested location this search also considers the current device position as
.
Parameters:
•
location
A NMAGeoCoordinates representing the location context used to search for nearby places
•
filters
HERE iOS SDK Developer's Guide
► API reference
267
A NMACategoryFilter representing the category filter
Returns:
The NMADiscoveryRequest if both parameters are valid
-(
*) createLookupRequestWithReferenceIdentifier:(NSString
*) referenceIdentifier inSource:(NSString *) source
Creates a NMAPlaceRequest based on a reference identifier and source.
The supported sources are "pvid", "sharing", "venues", "venues.content", "venues.venue",
"venues.destination", "building". See also Resource look-up .
"sharing" example:
The 'referenceIdentifier' argument to use is found in
. The 'referenceIdentifier' is the last path segment of the View URI.
Using the following example View URI: http://here.com/p/saWQ9Mjc2dTMzZGMtMzk0NGE0NzQ4YTYyNDk5Y2I3OTVjZjhiZWUzNDljOWM7bj1BbnRpcG9kZXM7Yz1jb2ZmZWUtdGVhO
3BoPSUyQjQ5MTc2MzgzNDAxMTg7bGF0PTUyLjUzMDkzO2xvbj0xMy40MDk5Mg
The sharing reference identifier is: saWQ9Mjc2dTMzZGMtMzk0NGE0NzQ4YTYyNDk5Y2I3OTVjZjhiZWUzNDljOWM7bj1BbnRpcG9kZXM7Yz1jb2ZmZWUtdGVhO
3BoPSUyQjQ5MTc2MzgzNDAxMTg7bGF0PTUyLjUzMDkzO2xvbj0xMy40MDk5Mg
For example:
NMAPlaceRequest* request =
[[NMAPlaces sharedPlaces] createLookupRequestWithReferenceIdentifier: @"saWQ9Mjc2dTMzZGMtMzk0NGE0NzQ4YTYyNDk5Y2I3OTVjZjhiZWUzNDljOWM7bj1BbnRpcG9kZXM7Yz1jb2ZmZWUtdGVhO
3BoPSUyQjQ5MTc2MzgzNDAxMTg7bGF0PTUyLjUzMDkzO2xvbj0xMy40MDk5Mg"
inSource:NMAPlacesSourceSharing];
"venues.venue" example:
The venue reference identifier for Alexa Shopping Center is DM_7171. The reference source is
NMAPlacesSourceVenuesVenue.
For example:
NMAPlaceRequest* request = [[NMAPlaces sharedPlaces] createLookupRequestWithReferenceIdentifier:@"DM_7171" inSource:NMAPlacesSourceVenuesVenue];
HERE iOS SDK Developer's Guide
► API reference
268
Parameters:
•
referenceIdentifier
The reference identifier of the requested
in a specified source (ie Core POI, Venue).
•
source
The NSString of the source in lower case (for examle pvid).
Returns:
The NMAPlaceRequest if the reference identifier is valid, nil otherwise
-(
*) createSearchRequestWithLocation:(
*) location query:(NSString *) query
Creates a NMAPlaces search request using a specified location and query.
The results of the search request are sets of places that match a user's search term in a specific location. Additional user's current position will also be sent to ensure you get the best results possible. The user's current position is only available if [
active] is true.
The viewport is a bounding box used to perform the search. To ensure you get the best results possible, you should match the viewport to your map if there is a map visible to the user. The
viewport is optional (see also
).
Parameters:
•
location
A NMAGeoCoordinates representing the query's location context used to search for results that are appropriate to the query parameter
•
query
NSString specifying the kind of places to locate
Returns:
The NMADiscoveryRequest if both parameters are valid, nil otherwise.
-(
*) createSuggestionRequestWithLocation:(
*) location partialTerm:(NSString *) partialTerm
Creates a NMAPlaces request to return a list of suggested search terms that are related to a specified location context and partial search term.
Note:
HERE iOS SDK Developer's Guide
► API reference
In addition to the requested location this search also considers the current device position as
.
Parameters:
•
location
A NMAGeoCoordinates representing the query location context
•
partialTerm
A NSString specifying the partial search term
Returns:
The NMASuggestionRequest if the location
is valid, nil otherwise
-(void) refreshTopLevelCategoriesWithCompletion:(
NMAPlacesCategoriesCompletionBlock
Refresh the localized top level categories for Places Search.
-(NSArray *) topLevelCategories
Return the localized top level categories for Places Search.
User can manually refresh the categories with refreshTopLevelCategoriesWithCompletion:
Note:
The list of categories is cached. The update request to Places backend is made periodically and when device locale is changed. If there is no cache or cache is being updated, a nil is returned. User should try again later.
Returns:
Class Method Details
+(
Returns the NMAPlaces singleton instance.
Note:
Use this method to obtain a NMAPlaces instance. Do not call init directly.
269
HERE iOS SDK Developer's Guide
► API reference
Returns:
shared NMAPlaces instance
NMARatings
Class Summary
class
NMARatings
Derived from: NSObject
Represents a summary of the user-supplied ratings for a NMAPlace.
Include:
NMAKit.framework/headers/NMARatings.h
Inheritance Diagrams
Figure 76: Public inheritance diagram for NMARatings
[For complete information, see the section
]
Public Property Summary
Table 100: Public Property
Public Property
[readable, assign]
The average rating for the NMAPlace
[readable, assign]
The number of individual votes that users provide for rating the NMAPlace
Class Details
Represents a summary of the user-supplied ratings for a
.
270
HERE iOS SDK Developer's Guide
► API reference
Public Property Details
[readable, assign] double average
The average rating for the
[readable, assign]
NSUInteger count
The number of individual votes that users provide for rating the
NMARequest
Class Summary
class
NMARequest
Derived from: NSObject
Represents a base interface for a search request.
Include:
NMAKit.framework/headers/NMARequest.h
Inheritance Diagrams
Figure 77: Public inheritance diagram for NMARequest
271
[For complete information, see the section
]
HERE iOS SDK Developer's Guide
► API reference
Public Property Summary
Table 101: Public Property
Public Property
[readable, writable, assign]
The maximum number of items in the response
[readable, writable, strong]
NSString *
NSString representing the preferred language for request responses
[readable, assign]
The NSArray of sources have been added for a NMAPlace
[readable, writable, strong]
NSString *
User-defined Tag as convenience method to identify NMARequest
[readable, writable, assign]
The bounding box in which to perform the search
Instance Method Summary
Table 102: Instance Method
Instance Methods
-(void)
This function adds the a reference identifier to be returned in the request results
-(BOOL)
Cancels any pending query request
-(NSError *)
) aBlock
Invokes an asynchronous query request with a specified block
-(NSError *)
(id<
NMAResultListener
>) aSearchEventListener
Invokes an asynchronous query request with a specified listener
Class Details
Represents a base interface for a search request.
272
HERE iOS SDK Developer's Guide
► API reference
273
Public Property Details
[readable, writable, assign]
NSUInteger collectionSize
The maximum number of items in the response.
Note:
The default value is 10. The maximum value is 100, if over, it's capped to 100.
[readable, writable, strong]
NSString * languagePreference
NSString representing the preferred language for request responses.
Default Value: [[NSLocale preferredLanguages] objectAtIndex:0].
Note:
languagePreference should be a valid code according to the IETF BCP-47 standard (see
http:// tools.ietf.org/html/bcp47
).
[readable, assign]
NSArray * sources
The NSArray of sources have been added for a
.
See also:
[readable, writable, strong]
NSString * userTag
User-defined Tag as convenience method to identify NMARequest.
Note:
The default value for userTag is empty string and user should assign any tag value with their own convention.
[readable, writable, assign]
* viewport
The bounding box in which to perform the search.
The viewport can act as an implicit location context in the absence of an explicit location context. To ensure you get the best results possible, you should match the viewport to your map if there is a map visible to the user.
HERE iOS SDK Developer's Guide
► API reference
Instance Method Details
-(void) addSource:(NSString *) source
This function adds the a reference identifier to be returned in the request results. See also
NMAPlace::referenceIdentifiersForSource:
.
Examples of reference identifiers are: "NMAPlacesSourcePVID" for HERE's core content product which provides map and POI data, "NMAPlacesSourceVenuesAll" for HERE's venue maps product whcih provides indoor maps for thousands of venues, "NMAPlacesSourceBuilding" for extruded building.
Parameters:
•
source
A string containing the source identifier to add.
-(BOOL) cancel
Cancels any pending query request.
-(NSError *) startWithBlock:(
Invokes an asynchronous query request with a specified block.
Parameters:
•
aBlock
A block to be executed upon completion of the request
Returns:
The appropriate NSError code
See also:
-(NSError *) startWithListener:(id<
NMAResultListener
>) aSearchEventListener
274
HERE iOS SDK Developer's Guide
► API reference
Invokes an asynchronous query request with a specified listener.
Parameters:
•
aSearchEventListener
A listener to listen for search results
Returns:
The appropriate NSError code
See also:
<NMAResultListener>
Protocol Summary
protocol
<NMAResultListener>
Derived from: <NSObject>
Represents an event listener that reports information about query progress changes and query completion.
Include:
NMAKit.framework/headers/NMAResultListener.h
Inheritance Diagrams
Figure 78: Public inheritance diagram for <NMAResultListener> – <NMAResultListener>
275
[For complete information, see the section
HERE iOS SDK Developer's Guide
► API reference
276
Instance Method Summary
Table 103: Instance Method
Instance Methods
-(void)
(
*) request didCompleteWithData:(id) data error:(NSError *)
error
Protocol Details
Represents an event listener that reports information about query progress changes and query completion.
Methods of this protocol are called on the main queue.
Instance Method Details
-(void) request:(
*) request didCompleteWithData:(id) data error:
(NSError *) error
NMAReverseGeocodeRequest
Class Summary
class
NMAReverseGeocodeRequest
Represents a request to retrieve NMAPlaceLocation data by way of NMAGeocoder search services.
Include:
NMAKit.framework/headers/NMAReverseGeocodeRequest.h
Inheritance Diagrams
Figure 79: Public inheritance diagram for NMAReverseGeocodeRequest
HERE iOS SDK Developer's Guide
► API reference
277
[For complete information, see the section
]
Public Property Summary
Table 104: Public Property
Public Property
[readable, writable, assign]
Deprecated: This method is deprecated as of NMA SDK 3.1. As this type of search no longer support this.
The text format of the request results
Class Details
Represents a request to retrieve
search services.
Note:
A NMAReverseGeocodeRequest is a kind of
, and its response is an instance of
.
Public Property Details
[readable, writable, assign]
textFormat
Deprecated: This method is deprecated as of NMA SDK 3.1. As this type of search no longer support this.
The text format of the request results.
NMAReverseGeocodeResult
Class Summary
class
NMAReverseGeocodeResult
Derived from: NSObject
Represents the result of a reverse geocoding request.
Include:
NMAKit.framework/headers/NMAReverseGeocodeResult.h
HERE iOS SDK Developer's Guide
► API reference
Inheritance Diagrams
Figure 80: Public inheritance diagram for NMAReverseGeocodeResult
278
[For complete information, see the section
]
Public Property Summary
Table 105: Public Property
Public Property
[readable, assign]
The distance between the result and the search input coordinates
[readable, assign]
The location data of the reverse geocode result
Class Details
Represents the result of a reverse geocoding request.
The data of a reverse geocoding result is represented by an instance of
, accessed via the location property. The distance between the result and the original search location is give by the distance property.
Public Property Details
[readable, assign] float distance
The distance between the result and the search input coordinates.
[readable, assign]
* location
The location data of the reverse geocode result.
HERE iOS SDK Developer's Guide
► API reference
NMASuggestionRequest
Class Summary
class
NMASuggestionRequest
Represents a request to retrieve a list of search terms.
Include:
NMAKit.framework/headers/NMASuggestionRequest.h
Inheritance Diagrams
Figure 81: Public inheritance diagram for NMASuggestionRequest
[For complete information, see the section
]
Public Property Summary
Table 106: Public Property
Public Property
[readable, writable, assign]
The text format of the request results
Class Details
Represents a request to retrieve a list of search terms.
Public Property Details
[readable, writable, assign]
textFormat
The text format of the request results.
Note:
279
HERE iOS SDK Developer's Guide
► API reference
The default value is NMATextFormatHTML.
280
Preuzimanje
Reklama