Home > Blockchain >  Delphi Android TMapView not showing 'Current Location' button on first launch
Delphi Android TMapView not showing 'Current Location' button on first launch

Time:12-09

I wanted to display a map on my Android to detect user's current location. I have set my API key, checked on uses permission required (fine location, course location, internet), set the TMapView properties (layer options, control options).

 object MapView1: TMapView
    Align = Client
    Zoom = 20.000000000000000000
    LayerOptions = [UserLocation]
    ControlOptions = [Zoom, MyLocation]
    OnMapClick = MapView1MapClick
  end

When I first launch on my android device, the current location button is not showing(img1). When I reopen the app from my android device, the current location button is showing nicely (img2). What could be the reason causing the current location button not to show on the first launch?

img1 img2

CodePudding user response:

This happens due to the map not being refresh after allowing the location permission. All you need to do is make sure that you refresh ur map after allowing the location permission. This should solve ur issue.

  • Related