A marker on Mappls Map can be added using only Mappls Pin. For this it will require an object of MapplsPointAnnotation
.
To create object of MapplsPointAnnotation
it will require Mappls Mappls Pin(unique code of a Place) in its initializer.
Swift
let annotation11 = MapplsPointAnnotation(mapplsPin: "7gbcyf")
mapView.addMapplsAnnotation(annotation11, completionHandler: nil)
Swift
var annotations = [MapplsPointAnnotation]()
let mapplsPins = [ "mmi000", "7gbcyf", "5MEQEL", "k595cm"]
for mapplsPin in mapplsPins {
let annotation = MapplsPointAnnotation(mapplsPin: mapplsPin)
annotations.append(annotation)
}
self.mapView.addMapplsAnnotations(annotations, completionHandler: nil)
Mappls's Map can be centered to a Place using its Mappls Pin. Different functions are available to achieve this. Below are code snippets to use it.
Swift
mapView.setMapCenterAtMapplsPin("mmi000", animated: false, completionHandler: nil)
mapView.setMapCenterAtMapplsPin("mmi000", zoomLevel: 17, animated: false, completionHandler: nil)
mapView.setMapCenterAtMapplsPin("mmi000", zoomLevel: 17, direction: 0, animated: false, completionHandler: nil)
Mappls's Map's bounds can be set to fit bounds for a list of Mappls Pins.
A method showMapplsPins:
is available to achieve this. Below is code snipped to demonstrated its usage
Swift
let mapplsPins = ["mmi000", "7gbcyf", "5MEQEL", "k595cm"]
self.mapView.showMapplsPins(MapplsPins, animated: false, completionHandler: nil)
Code snipet for getting distance between different locations using Mappls Pins is below. For more information please see here.
Directions between different locations can be get using Mappls Pins. For more information please see here and here.
For any queries and support, please contact:
Email us at apisupport@mappls.com
Support Need support? contact us!