How to add MapCircle in HERE Map android

381 Views Asked by At

I have added a marker in HERE map like below code.

hereMap.addMapObject(new MapMarker(new GeoCoordinate(lat, longi),setMapMarkerImage(R.drawable.zeroo)));

And with below code MapCircle not added in HERE map

MapCircle currentHereMapCircle = null;
currentHereMapCircle = new MapCircle(50.67,mm);
currentHereMapCircle.setRadius(50.67);
currentHereMapCircle.setFillColor(Color.CYAN);
currentHereMapCircle.setLineWidth(2);
currentHereMapCircle.setLineColor(Color.BLUE);
hereMap.addMapObject(currentHereMapCircle);`  

The app crashes when I add this code, any ideas why?

1

There are 1 best solutions below

1
On

This is a sample code that adds a MapCircle to a map:

MapCircle circle = new MapCircle(400.0, m_map.getCenter());
circle.setLineColor(Color.BLUE);
circle.setFillColor(Color.GRAY);
circle.setLineWidth(12);
m_map.addMapObject(circle);

Check the full implementation at: https://github.com/heremaps/here-android-sdk-examples/tree/master/map-objects