Skip to content

Latest commit

 

History

History
84 lines (60 loc) · 3.47 KB

MapmyIndiaMaps-E-Location-Strategy.md

File metadata and controls

84 lines (60 loc) · 3.47 KB

MapmyIndia APIs

e-Location Strategy in MapmyIndia's Map SDK for iOS

A marker on MapmyIndia Map can be added using only eLoc. For this it will require an object of MapmyIndiaPointAnnotation.

To create object of MapmyIndiaPointAnnotation it will require MapmyIndia eLoc(unique code of a Place) in its initializer.

Single Marker

Swift

let annotation11 = MapmyIndiaPointAnnotation(eloc: "eLoc")
mapmyIndiaMapView.addMapmyIndiaAnnotation(annotation11, completionHandler: nil)

Multiple Markers

Swift

var annotations = [MapmyIndiaPointAnnotation]()            
let eLocs = [ "mmi000", "7gbcyf", "5MEQEL", "k595cm"]
for eLoc in eLocs {
    let annotation = MapmyIndiaPointAnnotation(eloc: eLoc)
    annotations.append(annotation)
}
self.mapView.addMapmyIndiaAnnotations(annotations, completionHandler: nil)

MapmyIndia's Map can be centered to a Place using its eLoc. Different functions are available to achieve this. Below are code snippets to use it.

Swift

mapmyIndiaMapView.setMapCenterAtEloc("mmi000", animated: false, completionHandler: nil)
mapmyIndiaMapView.setMapCenterAtEloc("mmi000", zoomLevel: 17, animated: false, completionHandler: nil)
mapmyIndiaMapView.setMapCenterAtEloc("mmi000", zoomLevel: 17, direction: 0, animated: false, completionHandler: nil)

MapmyIndia's Map's bounds can be set to fit bounds for a list of eLocs. A method showELocs: is available to achieve this. Below is code snipped to demonstrated its usage

Swift

let eLocs = ["mmi000", "7gbcyf", "5MEQEL", "k595cm"]
self.mapView.showElocs(eLocs, animated: false, completionHandler: nil)

Code snipet for getting distance between different locations using eLocs is below. For more information please see here.

Directions between different locations can be get using eLocs. For more information please see here and here.

For any queries and support, please contact:

Email Email us at apisupport@mapmyindia.com

MapmyIndia Stack Overflow Stack Overflow Ask a question under the mapmyindia-api

MapmyIndia Support Support Need support? contact us!

MapmyIndia Blog Blog Read about the latest updates & customer stories

© Copyright 2020. CE Info Systems Pvt. Ltd. All Rights Reserved. | Terms & Conditions