This repository distributes a package rather than defining the complete product contract. Pair it with the owning SDK or product guide.
What this surface enables
Mappls Annotation Extension Native for iOS distributed via the SPM (Swift Package Manager).
No durable provider record or application workflow contract was established from the source identity or bounded document evidence; view, camera, callback, and authentication sessions alone do not make a source stateful.
Authority: Conservative Default · No durable-state signal promoted from incidental vocabularyiOS
MapsSearch PlacesTracking TelematicsCapture FeedbackIdentity Platform
Swift
No explicit authentication signal detected
Prepare the integration
- An iOS project with Xcode and the package manager required by the source release
- The corresponding product entitlement enabled for the developer application
Setup and usage examples
These examples were extracted from the canonical public source document and sanitized for credential-like values. Check the source branch and package version before copying into a production application.
let circle = MGLCircleStyleAnnotation(center: CLLocationCoordinate2D(latitude: 59.31, longitude: 18.06), radius: 3.0, color: .blue)Topics documented by the source
01Mappls Annotation Extension for iOS
The Mappls Annotation Extension is a lightweight library you can use with the Mappls Map SDK for iOS to quickly add basic shapes, icons, and other annotations to a map.
This extension leverages the power of runtime styling with an object oriented approach to simplify the creation and styling of annotations.
02Installation
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL. See Adding Package Dependencies to Your App.
03Dependencies
This library depends upon several Mappls's own libraries. All dependent libraries will be automatically installed on using SPM.
Below are list of dependcies which are required to run this SDK:
• MapplsAPICore - MapplsAPIKit - MapplsMaps
04MapplsAPICore
It is required to set MAPPLS's keys to use any MAPPL's SDK. Please see here to achieve this.
05Usage
The Mappls Annotation Extension supports the addition of circles, lines, polygons, and symbols. Each shape type has its own corresponding controller which manages the addition of multiple shape objects of the same type.
Since the map needs to be finished loading before adding shapes to it, all shapes should be added within the MGLMapView:didFinishLoadingStyle: delegate method.
06Circles (MGLCircleStyleAnnotation)
Circles represent a coordinate point on a map with an associated radius, measured in pixels.
Circle can be created by two ways.
One is by creating instance of MGLCircleStyleAnnotation, either using a coordinate or Mappls Pin.
See code below to plot circle on map:
Second is by passing a geoJSON (with point geometry) string in function create of instance of MGLCircleAnnotationController. As mentioned below.
07Lines (MGLLineStyleAnnotation)
Lines represent a connected series of coordinates.
Line can be created by two ways.
One is by creating instance of MGLLineStyleAnnotation using array of coordinates. As mentioned below.
Second is by passing a geoJSON (with line geometry) string in function create of instance of MGLLineAnnotationController. As mentioned below.
08Polygons (MGLPolygonStyleAnnotation)
Polygons represent a connected series of coordinates, where the first and last coordinates are equal.
Polygons can be created by two ways.
One is by creating instance of MGLPolygonStyleAnnotation using array of coordinates. As mentioned below.
Second is by passing a geoJSON (with polygon geometry) string in function create of instance of MGLPolygonAnnotationController. As mentioned below.
09Symbols (MGLSymbolStyleAnnotation)
Symbols represent a coordinate point on a map with a label and an associated optional icon image. An image must be supplied to the map's style before being able to assign it to be the icon image of a symbol.
Symbol can be created by two ways.
One is by creating instance of MGLSymbolStyleAnnotation either using a coordinate or Mappls Pin.
See code below to plot symbol marker on map:
Second is by passing a geoJSON (with point geometry) string in function create of instance of MGLSymbolAnnotationController. As mentioned below.
10Displaying callouts for style annotations
Style annotations support callouts that appear when the annotation is selected. Each callout can display additional information about its annotation.
1) To enable callouts for a style annotation, create a class property with the controller type you are enabling interaction for:
2) The style annotation must contain a title and must implement two delegate methods using the Maps SDK for iOS. The first method, annotationCanShowCallout should return true. The second method, viewFor annotation: should return an empty MGLAnnotationView matching the size of the style annotation's shape, as shown below.
11Supported Properties
Each MGLStyleAnnotation class can be assigned a specific set of properties to configure its layout and style. Additionally, MGLAnnotationControllers also have properties that can assign a specific layout property to all of its child MGLStyleAnnotations.
MGLCircleStyleAnnotation
• circleRadius - circleColor - circleOpacity - circleStrokeWidth - circleStrokeColor - circleStrokeOpacity
MGLCircleAnnotationController
• circleTranslation - circleTranslationAnchor - circlePitchAlignment - circleScaleAlignment
MGLLineStyleAnnotation
12Our many happy customers:
For any queries and support, please contact:
Email us at apisupport@mappls.com
Support Need support? contact us!
[](https://about.mappls.com/blog/)[](https://github.com/mappls-api)
[](https://twitter.com/mappls)[](https://www.linkedin.com/company/mappls/)[](https://www.youtube.com/channel/UCAWvWsh-dZLLeUU7J9HiOA)
@ Copyright 2022 CE Info Systems Pvt. Ltd. All Rights Reserved.
Service references found
URLs are sanitized during ingestion and may include documentation or legacy hosts. Use them to trace the source, not as a substitute for the current API contract.
https://www.mapmyindia.com/apihttps://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).https://www.mapmyindia.com/api/img/logos1/PhonePe.png)[](https://about.mappls.com/blog/)[](https://github.com/mappls-api)[https://www.npmjs.com/org/mapmyindiahttps://www.facebook.com/Mapplsofficial)[](https://twitter.com/mappls)[](https://www.linkedin.com/company/mappls/)[](https://www.youtube.com/channel/UCAWvWsh-dZLLeUU7_J9HiOAhttps://about.mappls.com/api/terms-&-conditionshttps://www.mappls.com/about/privacy-policyhttps://www.mappls.com/pdf/mappls-sustainability-policy-healt-labour-rules-supplir-sustainability.pdfhttps://www.mappls.com/pdf/Health-Safety-Management.pdfhttps://www.mappls.com/pdf/Environment-Sustainability-Policy-CSR-Report.pdf