简体   繁体   中英

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

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?

图像1 img2

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM