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.
Swift
let annotation11 = MapmyIndiaPointAnnotation(eloc: "eLoc")
mapmyIndiaMapView.addMapmyIndiaAnnotation(annotation11, completionHandler: nil)
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 us at apisupport@mapmyindia.com
Stack Overflow Ask a question under the mapmyindia-api
Support Need support? contact us!
Blog Read about the latest updates & customer stories
© Copyright 2020. CE Info Systems Pvt. Ltd. All Rights Reserved. | Terms & Conditions