HERE iOS SDK Developer's Guide

NMAMapObject

Class Summary

class NMAMapObject

Derived from: NMAUserObject

Represents a base class for all visible objects shown on a map.

Include: NMAKit.framework/headers/NMAMapObject.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAMapObject

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, assign] NMAMapLayerType   mapLayerType

Control the map layer (NMAMapLayerType) at which the object is rendered

[readable, weak] NMAMapContainer parent

The map object's container

[readable, assign] NMAMapObjectType   type

The map object's type

[readable, writable, assign] BOOL  visible

Indicates whether the visibility of the NMAMapObject on the map is enabled

[readable, writable, assign] NSUInteger  zIndex

The NSUInteger z-index (stacking order) for the NMAMapObject within its containing NMAMapContainer, or within the NMAMapView if the object was added to NMAMapView directly.

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

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

-(void) setVisibility:(BOOL) visible atZoomLevel:(float) zoomLevel

Sets the visibility of the map object at a specific zoom level.

-(void) setVisibility:(BOOL) visible fromZoomLevel:(float) fromZoomLevel toZoomLevel:(float) toZoomLevel

Sets the visibility of the map object for a range of zoom levels.

-(NSUInteger) uniqueId

Returns the unique ID value of the NMAMapObject

Class Details

Represents a base class for all visible objects shown on a map.

This class serves as a generalization (or base) for several more specified map object types, bundling their common properties. Objects implementing this interface can be grouped within a NMAMapContainer by way of the NMAMapContainer::addMapObject(NMAMapObject) method.

Note:

This class serves as a base class to other map object types and should not be instantiated directly.

Public Property Details

[readable, writable, assign] NMAMapLayerType  mapLayerType

Control the map layer (NMAMapLayerType) at which the object is rendered.

Note:

This property is valid only after the object is added to a NMAMapView. Setting the property will move the object to the new layer in the map view.

[readable, weak] NMAMapContainerparent

The map object's container. This will be nil if the map object does not belong to a container or was added to an NMAMapView directly.

[readable, assign] NMAMapObjectType  type

The map object's type.

[readable, writable, assign] BOOL visible

Indicates whether the visibility of the NMAMapObject on the map is enabled. Whether the map object is actually visible depends on whether the visible mask is set for the desired zoom level.

Note:

The getter is isVisible.

Note:

To customize the visibility of the map object for certain zoom levels, please refer to setVisibility:atZoomLevel or setVisibility:fromZoomLevel:toZoomLevel

[readable, writable, assign] NSUInteger zIndex

The NSUInteger z-index (stacking order) for the NMAMapObject within its containing NMAMapContainer, or within the NMAMapView if the object was added to NMAMapView directly.

Must be in the range NMAMapObjectMinimumZIndex..NMAMapObjectMaximumZIndex. The property will be clamped to this range if invalid values are specified.

Note:

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.

By default, the visibility flags for all zoom levels are 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.

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