Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Navmii SDK provides an easy way to present custom images on the map and to draw polylines. Children classes of NMGeoObject abstract class represent these custom images (NMGeoMarker) and polylines (NMGeoPolyline) in the SDK. NMMapView instance is responsible for creating and handling this type of objects.

CREATING A MARKER ON THE MAP

To present a marker on the map at specified coordinates with default image, instantiate it first with either initWithCoordinates: instance method or geoMarkerWithCoordinates: class method and, then, add it to the map using NMMapView instance's addGeoObject: method

Code Block
languagecpp
themeEclipse
NMGeoMarker *marker = [[NMGeoMarker alloc] initWithCoordinates:coords];
/* or, alternatively
NMGeoMarker *marker = [NMGeoMarker geoMakerWithCoordinates:coords];
*/
[mapView addGeoObject:marker];

To present a marker with specified image, use one of initWithCoordinates:andImagePath: and geoMarkerWithCoordinates:andImagePath: pair of methods. Make sure you add them to the map as in previous case:

Code Block
languagecpp
themeEclipse
NMGeoMarker *marker = [[NMGeoMarker alloc] initWithCoordinates:coords
                                                  andImagePath:pathToImage];
/* or, alternatively
NMGeoMarker *marker = [NMGeoMarker geoMakerWithCoordinates:coords
                                              andImagePath:pathToImage];
*/
[mapView addGeoObject:marker];