Skip to content

Latest commit

 

History

History
95 lines (63 loc) · 5.73 KB

MapplsPinStrategy.md

File metadata and controls

95 lines (63 loc) · 5.73 KB

Mappls Pin Strategy in Mappls's Map SDK for iOS

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.

Single Marker

Swift

let annotation11 = MapplsPointAnnotation(mapplsPin: "7gbcyf")
mapView.addMapplsAnnotation(annotation11, completionHandler: nil)

Multiple Markers

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.




Our many happy customers:


For any queries and support, please contact:

Email us at apisupport@mappls.com

Support Need support? contact us!



@ Copyright 2022 CE Info Systems Pvt. Ltd. All Rights Reserved.