Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement current location blue icon in Here Map

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));
like image 246
djk Avatar asked Jun 27 '17 17:06

djk


People also ask

How do I display current location on a map?

Click the blue-and-white target symbol near the bottom-right corner of the map to re-center the map and display your current location, which will be marked with a blue dot.

What is the blue icon on Google Maps?

The blue dot shows you where you are on the map. When Google Maps isn't sure about your location, you'll see a light blue circle around the blue dot. You might be anywhere within the light blue circle. The smaller the circle, the more certain the app is about your location.

Why is there no blue dot on Google Maps?

If the blue dot isn't visible or is grey, Maps can't find your current location and shows you the last location you visited. If there's something between you and any mobile towers, such as a multi-storey car park or tall buildings, then your blue dot might not be accurate.


2 Answers

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) {

}
like image 101
icaneatclouds Avatar answered Oct 23 '22 01:10

icaneatclouds


You can control the HERE Maps current location icon through com.here.android.mpa.mapping.PositionIndicator class.

Its instance is kept in com.here.android.mpa.mapping.MapView that might be wrapped in a fragment like com.here.android.mpa.mapping.SupportMapFragment.

Examples:

mapFragment.getPositionIndicator().setVisible(true)
mapView.getPositionIndicator().setAccuracyIndicatorVisible(true)
like image 1
xsveda Avatar answered Oct 23 '22 01:10

xsveda