Navmii SDK  2.2.0
Write yourself a navigation system in iOS
Instance Methods | Class Methods | Properties | List of all members
NMMapView Class Reference

Inherits UIView.

Instance Methods

(void) - loadMapScheme:
 
(void) - addGeoObjectsListener:
 
(void) - removeGeoObjectsListener:
 
(void) - addGeoObject:
 
(void) - addGeoObjects:
 
(void) - removeGeoObject:
 
(void) - removeGeoObjectById:
 
(void) - removeGeoObjects:
 
(void) - removeGeoObjectsByIds:
 
(void) - removeAllGeoObjects
 
(void) - hideAllGeoObjects
 
(void) - showAllGeoObjects
 
(void) - addMapTapListener:
 
(void) - removeMapTapListener:
 
(void) - addMapViewListener:
 
(void) - removeMapViewListener:
 
(void) - addDayNightChangeListener:
 
(void) - removeDayNightChangeListener:
 
(NMMapRectangle *) - mapRectangleFromCoordinates:
 
(NSArray< NMPlace * > *) - placesAtPointOnScreen:
 
(NSArray< NMPlace * > *) - placesAtCoordinates:radius:
 
(void) - makeSnapshot
 
(void) - makeSnapshotWithCompletion:
 

Class Methods

(double) + getDistanceFrom:to:
 

Properties

NMMapProjectionprojection
 
BOOL followsGpsPosition
 
BOOL followsGpsCourse
 
BOOL showsGpsPosition
 
CGPoint gpsPositionAnchorOnScreen
 
NSUInteger detailLevel
 
BOOL isInDayMode
 
CGFloat minZoomLevel
 
CGFloat maxZoomLevel
 
BOOL mapPanningGestureEnabled
 
BOOL mapRotationGestureEnabled
 
BOOL mapZoomGestureEnabled
 
BOOL mapTiltGestureEnabled
 
BOOL zoomInOnDoubleTapEnabled
 
BOOL zoomOutOnDualTapEnabled
 
NMAutozoomMode autozoomMode
 
BOOL autozoomEnabled
 
BOOL jamsShownOnMap
 
BOOL poisShownOnMap
 
BOOL usersShownOnMap
 
BOOL eventsShownOnMap
 
BOOL speedCamerasShownOnMap
 
UIColor * routeLineColor
 
NMCameraControllercameraController
 
NMDirectionArrowStyledirectionArrowStyle
 
NSArray< NSString * > * availableMapSchemes
 
NSString * activeMapScheme
 

Detailed Description

NMMapView should be used to display a geographical map.

Method Documentation

◆ addDayNightChangeListener:()

- (void) addDayNightChangeListener: (addDayNightChangeListener(listener:))  NS_SWIFT_NAME

Adds a listener responding to events described in NMDayNightChangeListener protocol. You can add multiple listeners using this method.

Parameters
listenerAn object conforming to NMDayNightChangeListener protocol to be added to listeners.

◆ addGeoObject:()

- (void) addGeoObject: (addGeoObject(geoObject:))  NS_SWIFT_NAME

Starts rendering the specified NMGeoObject on the map. For more information please refer to NMGeoObject, NMGeoMarker and NMGeoPolyline documentation.

◆ addGeoObjects:()

- (void) addGeoObjects: (addGeoObjects(geoObjects:))  NS_SWIFT_NAME

Starts rendering the specified NMGeoObjects on the map.

◆ addGeoObjectsListener:()

- (void) addGeoObjectsListener: (addGeoObjectsListener(listener:))  NS_SWIFT_NAME

Adds the listener object conforming to the NMGeoObjectListener protocol. The map view can have multiple listeners. The listeners are being notified when user interacts with NMGeoObjects displayed on the map. For more information please refer to NMGeoObjectListener documentation.

◆ addMapTapListener:()

- (void) addMapTapListener: (addMapTapListener(listener:))  NS_SWIFT_NAME

Adds a listener responding to events described in NMMapTapListener protocol. You can add multiple listeners using this method.

Parameters
listenerAn object conforming to NMMapTapListaner protocol to be added to listeners.

◆ addMapViewListener:()

- (void) addMapViewListener: (addMapViewListener(listener:))  NS_SWIFT_NAME

Adds a listener responding to events described in NMMapViewListener protocol. You can add multiple listeners using this method.

Parameters
listenerAn object conforming to NMMapViewListener protocol to be added to listeners.

◆ getDistanceFrom:to:()

+ (double) getDistanceFrom: (NMMapCoordinates *)  coordinatesFrom
to: (NMMapCoordinates *)  coordinatesTo 

Returns the distance as the crow flies in meters between the specified coordinates.

Parameters
coordinatesFromThe first one of two coordinates to measure distance between.
coordinatesToThe second one of two coordinates to measure distance between.
Returns
distance in meters between coordinates.

◆ hideAllGeoObjects()

- (void) hideAllGeoObjects

Stops rendering of all NMGeoObjects presented on the map.

◆ loadMapScheme:()

- (void) loadMapScheme: (NSString *)  schemeId

Loads map scheme with the specified scheme ID. Use availableMapSchemes property to get all the available scheme IDs.

◆ makeSnapshot()

- (void) makeSnapshot

Makes a snapshot of NMMapView as rendered in the moment of calling the method. The resulting UIImage will be passed through onSnapshotReady: event of NMMapViewListener when ready.

◆ makeSnapshotWithCompletion:()

- (void) makeSnapshotWithCompletion: (void(^)(UIImage *_Nullable image))  completion

Makes a snapshot of NMMapView as rendered in the moment of calling the method. The resulting UIImage will be passed in the specified completion handler.

◆ mapRectangleFromCoordinates:()

- (NMMapRectangle *) mapRectangleFromCoordinates: (NSArray< NMMapCoordinates * > *)  coordinates
Returns
a NMMapRectangle circumbscribing the specified coordinates
Parameters
coordinatesArray of coordinates to circumbsribed.

◆ placesAtCoordinates:radius:()

- (NSArray<NMPlace *> *) placesAtCoordinates: (NMMapCoordinates *)  coordinates
radius: (CGFloat)  radius 

Returns an array of NMPlaces located at specified coordinates.

Parameters
coordinatesCoordinates at which the search will be performed.
radiusRadius from the coordinates defining the geo area where the search will be peformed.

◆ placesAtPointOnScreen:()

- (NSArray<NMPlace *> *) placesAtPointOnScreen: (CGPoint)  point

Returns an array of NMPlaces located at coordinates corresponding to a screen position.

Parameters
pointScreen position which will be converted to search coordinates.

◆ removeAllGeoObjects()

- (void) removeAllGeoObjects

Removes all NMGeoObjects added to the map.

◆ removeDayNightChangeListener:()

- (void) removeDayNightChangeListener: (removeDayNightChangeListener(listener:))  NS_SWIFT_NAME

Removes a listener responding to events described in NMDayNightChangeListener.

Parameters
listenerAn object conforming to NMDayNightChangeListener protocol to be removed from listeners.

◆ removeGeoObject:()

- (void) removeGeoObject: (removeGeoObject(geoObject:))  NS_SWIFT_NAME

Stops rendering the specified NMGeoObject on the map.

◆ removeGeoObjectById:()

- (void) removeGeoObjectById: (removeGeoObject(geoObjectId:))  NS_SWIFT_NAME

Stops rendering NMGeoObject, which has the specified ID, on the map.

◆ removeGeoObjects:()

- (void) removeGeoObjects: (removeGeoObjects(geoObjects:))  NS_SWIFT_NAME

Stops rendering the specified NMGeoObjects on the map.

◆ removeGeoObjectsByIds:()

- (void) removeGeoObjectsByIds: (removeGeoObjects(geoObjectIds:))  NS_SWIFT_NAME

Stops rendering NMGeoObjects, which have the specified IDs, on the map.

◆ removeGeoObjectsListener:()

- (void) removeGeoObjectsListener: (removeGeoObjectsListener(listener:))  NS_SWIFT_NAME

Removes the listener of user's interaction with NMGeoObjects on map.

◆ removeMapTapListener:()

- (void) removeMapTapListener: (removeMapTapListener(listener:))  NS_SWIFT_NAME

Removes a listener responding to events described in NMMapTapListener.

Parameters
listenerAn object conforming to NMMapTapListener protocol to be removed from listeners.

◆ removeMapViewListener:()

- (void) removeMapViewListener: (removeMapViewListener(listener:))  NS_SWIFT_NAME

Removes a listener responding to events described in NMMapViewListener.

Parameters
listenerAn object conforming to NMMapViewListener protocol to be removed from listeners.

◆ showAllGeoObjects()

- (void) showAllGeoObjects

Resumes rendering of all NMGeoObjects presented on the map.

Property Documentation

◆ activeMapScheme

- (NSString*) activeMapScheme
readwritenonatomicstrong

Returns current active map scheme. Allows to load map scheme by specifying its ID. Use availableMapSchemes property to get all the available scheme IDs.

◆ autozoomEnabled

- (BOOL) autozoomEnabled
readwritenonatomicassign

Enables/disables the autozoom. Refer to the NMAutozoomMode for more information.

◆ autozoomMode

- (NMAutozoomMode) autozoomMode
readwritenonatomicassign

Current autozoom mode. Refer to the NMAutozoomMode for more information.

◆ availableMapSchemes

- (NSArray<NSString *>*) availableMapSchemes
readnonatomicassign

Returns names of available map schemes.

◆ cameraController

- (NMCameraController*) cameraController
readnonatomicstrong

CameraController provides the ability to manage map rotation, tilt and zoom via changing the camera position (heading, pitch and zoom).

◆ detailLevel

- (NSUInteger) detailLevel
readnonatomicassign

Current detail level of map rendering.

◆ directionArrowStyle

- (NMDirectionArrowStyle*) directionArrowStyle
readwritenonatomicstrong

Provides the ability to customize the way direction arrows render on map.

◆ eventsShownOnMap

- (BOOL) eventsShownOnMap
readwritenonatomicassign

Enables/disables showing road event icons on map.

◆ followsGpsCourse

- (BOOL) followsGpsCourse
readwritenonatomicassign

Enables/disables the "following GPS heading" mode.

@discussion When set to YES, SDK changes map camera heading according to the course of the GPS position. When set to NO, GPS updates don't affect the heading of the camera position.

◆ followsGpsPosition

- (BOOL) followsGpsPosition
readwritenonatomicassign

Enables/disables the "following GPS position" mode.

@discussion When set to YES, screen coordinates of GPS position are stored and remain upon GPS position update. When set to NO, GPS updates don't affect the targetLocation of the camera position.

◆ gpsPositionAnchorOnScreen

- (CGPoint) gpsPositionAnchorOnScreen
readwritenonatomicassign

CGPoint defining relative position of the GPS arrow on screen. Each coordinate of the point should be in the range 0..1. So the top left corner of the screen is {0,0} point and the bottom right corner is {1,1}.

◆ isInDayMode

- (BOOL) isInDayMode
readnonatomicassign

Indicates whether the map is currently being rendered in day or night mode.

◆ jamsShownOnMap

- (BOOL) jamsShownOnMap
readwritenonatomicassign

Enables/disables showing traffic jams on map.

◆ mapPanningGestureEnabled

- (BOOL) mapPanningGestureEnabled
readwritenonatomicassign

Enables/disables the panning gesture, which is used to pan the camera along the map. This gesture changes the targetLocation parameter of the current camera position.

◆ mapRotationGestureEnabled

- (BOOL) mapRotationGestureEnabled
readwritenonatomicassign

Enables/disables the rotation gesture, which is used to change the heading of the map. This gesture changes the heading parameter of the current camera position.

◆ mapTiltGestureEnabled

- (BOOL) mapTiltGestureEnabled
readwritenonatomicassign

Enables/disables the tilt gesture (moving two fingers up and down the screen). This gesture changes the pitch parameter of the current camera position.

◆ mapZoomGestureEnabled

- (BOOL) mapZoomGestureEnabled
readwritenonatomicassign

Enables/disables the pinch gesture, which is used to zoom in and zoom out the map. This gesture changes the zoom parameter of the current camera position.

◆ maxZoomLevel

- (CGFloat) maxZoomLevel
readnonatomicassign

Maximum value of map zoom.

◆ minZoomLevel

- (CGFloat) minZoomLevel
readnonatomicassign

Minimal value of map zoom.

◆ poisShownOnMap

- (BOOL) poisShownOnMap
readwritenonatomicassign

Enables/disables showing POI icons on map.

◆ projection

- (NMMapProjection*) projection
readnonatomicstrong

Current projection used by map renderer.

◆ routeLineColor

- (UIColor*) routeLineColor
readwritenonatomicstrong

Sets the main color of the route line. Setting this color doesn't affect traffic jam colors.

◆ showsGpsPosition

- (BOOL) showsGpsPosition
readwritenonatomicassign

Enables/disables displaying the GPS position icon on map.

◆ speedCamerasShownOnMap

- (BOOL) speedCamerasShownOnMap
readwritenonatomicassign

Enables/disables showing speed camera icons on map.

◆ usersShownOnMap

- (BOOL) usersShownOnMap
readwritenonatomicassign

Enables/disables showing users on map.

◆ zoomInOnDoubleTapEnabled

- (BOOL) zoomInOnDoubleTapEnabled
readwritenonatomicassign

Enables/disables zooming in on a double tap (two quick taps in a row) gesture. Zoom in factor is 1.8.

◆ zoomOutOnDualTapEnabled

- (BOOL) zoomOutOnDualTapEnabled
readwritenonatomicassign

Enables/disables zooming out on a dual tap (tap with two fingers simultaneously) gesture. Zoom out factor is 1.8.