How to implement current location blue icon in Here Map

djk picture djk · Jun 27, 2017 · Viewed 8.1k times · Source

I am working with the Here Map SDK and I need to show a blue icon with circle animation for current location like in image.

enter image description here

Can anyone tell me how to do it.

Right now I have code which sets the icon only which is blue dot. I don't know how to add circle animation to it.

Note that the mMap reference is a Map object from the Here Android SDK.

 mMap.getPositionIndicator().setVisible(true);
                    mMap.getPositionIndicator().setZIndex(0);
                    mMap.setZoomLevel(15);
                    mMap.getPositionIndicator().setAccuracyIndicatorVisible(true);
                    mMap.getPositionIndicator().setMarker(createImage(R.drawable.ic_location_dot));

Answer

icaneatclouds picture icaneatclouds · Jul 12, 2017

Try this one:

mMap.setMyLocationEnabled(true);

It enables or disables the my-location layer. While enabled and the location is available, the my-location layer continuously draws an indication of a user's current location and bearing, and displays UI controls that allow a user to interact with their location (for example, to enable or disable camera tracking of their location and bearing).

Much better if you place it under:

@Override
public void onMapReady(GoogleMap googleMap) {

}