2

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.

RohanB
  • 294
  • 2
  • 5
  • 19
  • 1
    It looks like they don't have an equivalent to the "My Location" button. However, they have the [PositionIndicator](https://developer.here.com/mobile-sdks/documentation/android-starter/topics/map-positioning.html) class, take a look here for an example of how to use it: https://stackoverflow.com/questions/43325005/here-api-offset-map-center – Daniel Nugent Jul 17 '17 at 21:26

1 Answers1

1

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].

AndrewJC
  • 1,318
  • 12
  • 11
  • 1
    P.S. You can also have a look at https://github.com/heremaps/here-android-sdk-examples for more examples of using the HERE SDK for Android but I don't believe there is explicitly an example of implementing a "my location" button. – AndrewJC Jul 17 '17 at 21:37