HERE iOS SDK Developer's Guide

NMAMapMarker

Class Summary

class NMAMapMarker

Derived from: NMAMapObject

Represents a marker used to display an icon on a geographical position on a map.

Include: NMAKit.framework/headers/NMAMapMarker.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAMapMarker

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, assign] CGPoint  anchorOffset

The CGPoint offset of the NMAMapMarker from its anchored location.

[readable, writable, strong] NMAGeoCoordinates coordinates

The geographical coordinates at which the NMAMapMarker is displayed on a map

[readable, writable, strong] UIImage *  icon

The UIImage displayed at the marker location

[readable, writable, assign] NMAInfoBubbleEventBlock   infoBubbleEventBlock

This block is called when the info bubble is tapped

[readable, writable, assign] NSString *  textDescription

Description text for the NMAMapMarker

[readable, writable, assign] NSString *  title

The current title for the default info bubble

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(BOOL) hideInfoBubble

Hide the info bubble from NMAMapView.

-(instancetype) initWithGeoCoordinates:( NMAGeoCoordinates *) coordinates

Initializes a NMAMapMarker instance with the specified NMAGeoCoordinates

-(instancetype) initWithGeoCoordinates:( NMAGeoCoordinates *) coordinates image:(UIImage *) image

Initializes a NMAMapMarker instance with the specified NMAGeoCoordinates and UIImage for the displayed icon

-(CGPoint) setAnchorOffsetUsingLayoutPosition:( NMALayoutPosition ) position

-(BOOL) showInfoBubble

Display the default info bubble if the NMAMapMarker's title has been set to something non-nil. The info bubble is displayed only after the NMAMapMarker is added onto a NMAMapView, otherwise making this call would make no effects. Also a non-zero length of the title or the textDescription is required.

-(BOOL) showInfoBubble:(UIView *) view

Display the view passed as an info bubble.

Class Method Summary

Table 3. Class Methods
Class Methods

+(instancetype) mapMarkerWithGeoCoordinates:( NMAGeoCoordinates *) coordinates

A convenience method to construct an NMAMapMarker at the specified coordinates

+(instancetype) mapMarkerWithGeoCoordinates:( NMAGeoCoordinates *) coordinates image:(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 offset 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] NMAGeoCoordinatescoordinates

The geographical coordinates at which the NMAMapMarker is displayed on a map.

[readable, writable, strong] UIImage * icon

The UIImage displayed at the marker location.

[readable, writable, assign] NMAInfoBubbleEventBlock  infoBubbleEventBlock

This block is called when the info bubble is tapped. Default is nil.

[readable, writable, assign] NSString * textDescription

Description text for the NMAMapMarker. This is shown below the title. Default is nil.

[readable, writable, assign] NSString * title

The current title for the default info bubble. Default is nil.

Instance Method Details

-(BOOL) hideInfoBubble

Hide the info bubble from NMAMapView.

Returns:

YES If the info bubble is successfully hidden from NMAMapView. NO if the info bubble is not attached to this NMAMapMarker.

-(instancetype) initWithGeoCoordinates:( NMAGeoCoordinates *) coordinates

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:( NMAGeoCoordinates *) coordinates 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:( NMALayoutPosition ) position

A convenience function to set where the NMAMapMarker is attached to its anchor

Parameters:

  • position

    A NMAnchorLocation for anchoring the marker icon.

Returns:

The CGPoint offset value that was applied to the anchorOffset property

-(BOOL) showInfoBubble

Display the default info bubble if the NMAMapMarker's title has been set to something non-nil. The info bubble is displayed only after the NMAMapMarker is added onto a NMAMapView, otherwise making this call would make no effects. Also a non-zero length of the title or the textDescription is required.

As only one info bubble can be displayed on the map at a time, thus when calling showInfoBubble on a different NMAMapMarker, the current info bubble on the display will automatically be closed before the newly selected one is shown.

Returns:

YES If the MapMarker meets all the requirements to show the bubble.

-(BOOL) showInfoBubble:(UIView *) view

Display the view passed as an info bubble.

Parameters:

  • view

    The view to be used as the info bubble view.

Returns:

YES If the MapMarker meets all the requirements to show the bubble.

See also:

showInfoBubble

Class Method Details

+(instancetype) mapMarkerWithGeoCoordinates:( NMAGeoCoordinates *) coordinates

A convenience method to construct an NMAMapMarker at the specified coordinates.

Parameters:

+(instancetype) mapMarkerWithGeoCoordinates:( NMAGeoCoordinates *) coordinates image:(UIImage *) image

A convenience method to construct an NMAMapMarker at the specified coordinates and with a UIImage icon.

Parameters:

  • coordinates

    The NMAGeoCoordinates at which to create the map marker.

  • image

    The UIImage to use for the marker icon.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.