Map SDK - iOS
Specifications
- Minimum iOS version: iOS 13.0
- Xcode Version: 12 or later
Sample App
Please refer to theGithub Sample Appfor getting better clarity on same.
Set up
xcframeworks
in your iOS project. Make sure you embed
all the frameworks in General > Frameworks, Libraries and Embedded Content.
Next, You need to add Location Permission Authorization in your Info.plist file,Load the map using the service instance. Ideally this method should be called in viewdidLoad() method of viewcontroller
Features
- Dynamic Maps
- Camera and View
- Polyline
- Shape
- Marker
- Info Window
- Map Events and Gesture
- Traffic Polyline
- Marker Clustering
Dynamic Map
To render a map, you need to initialise OlaMapService first and then call loadMap(_:)
Parameter name | Description |
---|---|
apikey | APIKey from Ola Maps Dashboard |
tileURL | Refer Tiles API in API Reference |
projectId | Refer Dashboard for Project Identifier |
userId | Custom UserID which is identified by Organization |
Map Camera
You can control the Map POV area and bounds area which you want to show.
Events and Gestures
This will enable rotation selection capability on Map, you can rotate the map by using two fingers.
Then, You will set of extra gesture delegate callback which comes with OlaMapServiceDelegate
Info Window
You can draw a Info Window which is a tool tip kind of view on Map.
And, to delete Info Window you can use
Map Region Bounds
You can control the Map Visible Bounds when you have array of coordinates.
Marker
- Create Annotation Marker
- Delete Annotation
We have created CustomAnnotationView Type which is inherited from OlaAnnotation.
You will need AnnotationId to delete any annotation from the map.
Polyline
You will need an array of OlaCoordinates to draw a solid polyline
- Create Polyline
- Delete Polyline
Shape
We have a capability to draw a geometrical shape like Polygon or Circle.
- Create Polygon
- Remove Polygon
You need to call drawPolgon(_:) to draw Polygon Geometry
You need to use deletePolygon(_:) method
For Circle, you can use `drawCircle(_:)` method.
Traffic Polyline
Along with Solid Polyline, we have the capability to draw Segmented Polyline. This data you will get from Directions API. Check Platform Documentation.
Marker Clustering
We have a capability to cluster markers under a single labled marker. In simple words, if you've large marker rendered in a single area, then map will automatically cluster them in a single marker with a label on in.
- backgroundColor: Background Color of Cluster View
- opacity: Opacity of Cluster View
- radius: Cluster's Zone Radius
- cluserViewRadius: Radius of Cluster View
- borderWidth: Border Width of Cluster View
- borderColor: Border Width of Cluster View
- fontSize: Text Size of Text Label on Cluster View
- fontColor: Color of Text Label on Cluster View