To use/ integrate Mappls Annotation plugin in android application follow the below mentioned steps :
For more info visit here : mappls-android-sdk/docs/v1.0.7/AnnotationPlugin.md at main · mappls-api/mappls-android-sdk · GitHub
1. Add the plugin dependency in your app-level build.gradle file.
implementation 'com.mappls.sdk:annotation-plugin:1.0.1'
2. 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());
3. Initialize the Annotation plugin using these 4 Manager classes :
SymbolManager
LineManager
FillManager
CircleManager
4. Initialize SymbolManager (Marker)
symbolManager = new SymbolManager(mapView, mapplsMap, style);
5. Initialize Linemanager (Polyline)
lineManager = new LineManager(mapView, mapplsMap, style);
6. Initialise FillManager (Polygon)
fillManager = new FillManager(mapView, mapplsMap, style);
7. Initialize CircleManager (Circle)
circleManager = new CircleManager(mapView, mapplsMap, style);
# Add Annotations Using Symbol Options :
//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 Line Using Line Options
// 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);