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, assign] BOOL  draggable

Sets whether this marker is draggable or not

[readable, writable, strong] NMAImage icon

The NMAImage displayed at the marker location

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(nonnull instancetype) initWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates

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

-(nonnull instancetype) initWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates icon:(nonnull NMAImage *) icon

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

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

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

-(void) resetIconSize

Resets the icon size to the default zoom values from the map

-(CGPoint) setAnchorOffsetUsingLayoutPosition:( NMALayoutPosition ) position

-(void) setSize:(CGSize) size forZoomLevel:(NSUInteger) zoomLevel

Sets the preferred icon size at a certain zoom level

-(void) setSize:(CGSize) size forZoomRange:(NSRange) zoomRange

Sets the preferred icon size in a certain zoom level range

Class Method Summary

Table 3. Class Methods
Class Methods

+(nonnull instancetype) mapMarkerWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates

A convenience method to construct an NMAMapMarker at the specified coordinates

+(nonnull instancetype) mapMarkerWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates icon:(nonnull NMAImage *) icon

A convenience method to construct an NMAMapMarker at the specified coordinates and with an NMAImage icon

+(nonnull instancetype) mapMarkerWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates image:(nonnull 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 and rotation.

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.

Note:

If the coordinates have a positive altitude value, the marker will be displayed above the plane of the map. Conversely, negative altitude values will hide the marker below the map. Set the altitude to zero to display the marker in the plane of the map.

Note:

The NMAViewObject "location" property will return these coordinates;

[readable, writable, assign] BOOL draggable

Sets whether this marker is draggable or not. By default, the marker is not draggable.

[readable, writable, strong] NMAImageicon

The NMAImage displayed at the marker location.

Instance Method Details

-(nonnull instancetype) initWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates

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

Parameters:

  • coordinates

    A NMAGeoCoordinates representing the map coordinates for displaying the NMAMapMarker

Returns:

The NMAMapMarker

-(nonnull instancetype) initWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates icon:(nonnull NMAImage *) icon

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

Parameters:

  • coordinates

    A NMAGeoCoordinates representing the map coordinates for displaying the NMAMapMarker

  • icon

    A NMAImage representing the icon for the NMAMapMarker

Returns:

The NMAMapMarker

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

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

Parameters:

  • coordinates

    A NMAGeoCoordinates representing the map coordinates for displaying the NMAMapMarker

  • image

    A UIImage to use to create the NMAImage marker of the icon.

Returns:

The NMAMapMarker

-(void) resetIconSize

Resets the icon size to the default zoom values from the map.

-(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

-(void) setSize:(CGSize) size forZoomLevel:(NSUInteger) zoomLevel

Sets the preferred icon size at a certain zoom level.

Note:

This method only affects rendering of SVG icons by overriding the default rendering size.

Parameters:

  • size

    The preferred icon size in points (not pixels).

  • zoomLevel

    Target map zoom level.

-(void) setSize:(CGSize) size forZoomRange:(NSRange) zoomRange

Sets the preferred icon size in a certain zoom level range.

Note:

This method only affects rendering of SVG icons.

Parameters:

  • size

    The preferred icon size in points (not pixels).

  • zoomRange

    NSRange for the zoom level.

Class Method Details

+(nonnull instancetype) mapMarkerWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates

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

Parameters:

+(nonnull instancetype) mapMarkerWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates icon:(nonnull NMAImage *) icon

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

Parameters:

+(nonnull instancetype) mapMarkerWithGeoCoordinates:(nonnull NMAGeoCoordinates *) coordinates image:(nonnull 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.