Search code examples
androidgeolocationhere-api

How to display my location button on Here Maps for Android


I am using the Here map api to show the here map in android fragment. I am successful in showing the here map in fragment. But i cannot able to show "My Location" button on left corner of here map. (I am using the premium plan) So, How do I show my location button on a Here Map?

For google map api, we can add "My current location" button like explained in (How to display my location on Google Maps for Android API v2). I am looking for the same functionality using Here api.


Solution

  • There is no built-in location button UI for the HERE SDK as there is for the Google SDK. You will have to implement the button UI yourself and have it call Map#setCenter(GeoCoordinate point, Animation animation) [1] when pressed. You can get the current location to hand to setCenter using the PositioningManager#getPosition() API [2].