Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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: 

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:

NMGeoMarker *marker = [[NMGeoMarker alloc] initWithCoordinates:coords
                                                  andImagePath:pathToImage];
/* or, alternatively
NMGeoMarker *marker = [NMGeoMarker geoMakerWithCoordinates:coords
                                              andImagePath:pathToImage];
*/
[mapView addGeoObject:marker];
  • No labels