The Mappls Annotation Plugin simplifies the way to set and adjust the visual properties of annotations on a Mappls map.
This Plugin is uses to plot Symbol (marker), Line, Fill(Polygon) and circle on a Map.
Add below dependency in your app-level build.gradle
implementation 'com.mappls.sdk:annotation-plugin:1.0.1'
Add your API keys to the SDK (in your application's onCreate() or before using map)
MapplsAccountManager.getInstance().setRestAPIKey(getRestAPIKey());
MapplsAccountManager.getInstance().setMapSDKKey(getMapSDKKey());
MapplsAccountManager.getInstance().setAtlasClientId(getAtlasClientId());
MapplsAccountManager.getInstance().setAtlasClientSecret(getAtlasClientSecret());
MapplsAccountManager.getInstance().restAPIKey = getRestAPIKey()
MapplsAccountManager.getInstance().mapSDKKey = getMapSDKKey()
MapplsAccountManager.getInstance().atlasClientId = getAtlasClientId()
MapplsAccountManager.getInstance().atlasClientSecret = getAtlasClientSecret()
To initialise the plugin there are Four Manager classes:
SymbolManager
LineManager
FillManager
CircleManager
symbolManager = new SymbolManager(mapView, mapplsMap, style); //For Marker
symbolManager = SymbolManager(mapView, mapplsMap, style); //For Marker
lineManager = new LineManager(mapView, mapplsMap, style); // For Polyline
lineManager = LineManager(mapView, mapplsMap, style); // For Polyline
fillManager = new FillManager(mapView, mapplsMap, style); // For Polygon
fillManager = FillManager(mapView, mapplsMap, style); // For Polygon
circleManager = new CircleManager(mapView, mapplsMap, style); //For Cirle
circleManager = CircleManager(mapView, mapplsMap, style); //For Cirle
Use SymbolOptions
to add the marker:
//Add Custom Image
style.addImage("map-marker-image", bitmap);
// Create a symbol at the specified location.
SymbolOptions symbolOptions = new SymbolOptions()
.position(latLng)
.icon("map-marker-image")
// Use the manager to draw the symbol.
symbol = symbolManager.create(symbolOptions);
//Add Custom Image
style.addImage("map-marker-image", bitmap);
// Create a symbol at the specified location.
val symbolOptions = SymbolOptions()
.position(latLng)
.icon("map-marker-image")
// Use the manager to draw the symbol.
symbol = symbolManager?.create(symbolOptions)
Use LineOptions
to add the Polyline
// Use options to color it red.
LineOptions lineOptions = new LineOptions()
.points(polyline)
.lineColor("#D81B60")
.lineWidth(1.0f);
// Use the manager to draw the annotation.
lineManager.create(lineOptions);
// Use options to color it red.
val lineOptions = LineOptions()
.points(polyline)
.lineColor("#D81B60")
.lineWidth(1.0f)
// Use the manager to draw the annotation.
lineManager?.create(lineOptions)
Use FillOptions
to add the Polygon
// Use options to color it red.
FillOptions fillOptions = new FillOptions()
.points(polygon)
.fillColor("#D81B60");
// Use the manager to draw the annotation.
fillManager.create(fillOptions);
// Use options to color it red.
val fillOptions = FillOptions()
.points(polygon)
.fillColor("#D81B60")
fillManager?.create(fillOptions)
Use CircleOptions
to add the Circle
// Use options to color it red.
CirlceOptions circleOptions = new CircleOptions()
.position(centerPoint)
.radius(5.0f)
.circleColor("#D81B60");
// Use the manager to draw the annotation.
cirlceManager.create(circleOptions);
// Use options to color it red.
val circleOptions = CircleOptions()
.position(centerPoint)
.radius(5.0f)
.circleColor("#D81B60")
cirlceManager?.create(circleOptions)
For any queries and support, please contact:
Email us at apisupport@mappls.comSupport Need support? contact us!
@ Copyright 2024 CE Info Systems Ltd. All Rights Reserved.
Terms & Conditions | Privacy Policy | Supplier Sustainability Policy | Health & Safety Policy | Environmental Policy & CSR Report
Customer Care: +91-9999333223