[英]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.我想在我的 Android 上显示 map 以检测用户的当前位置。 I have set my API key, checked on uses permission required (fine location, course location, internet), set the TMapView properties (layer options, control options).我已经设置了我的 API 密钥,检查了所需的使用权限(精细位置、课程位置、互联网),设置了 TMapView 属性(图层选项、控制选项)。
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).当我第一次在我的 android 设备上启动时,当前位置按钮未显示(img1)。 When I reopen the app from my android device, the current location button is showing nicely (img2).当我从 android 设备重新打开应用程序时,当前位置按钮显示良好(img2)。 What could be the reason causing the current location button not to show on the first launch?导致当前位置按钮在第一次启动时不显示的原因可能是什么?
This happens due to the map not being refresh after allowing the location permission.这是因为 map 在允许位置权限后未刷新。 All you need to do is make sure that you refresh ur map after allowing the location permission.您需要做的就是确保在允许位置权限后刷新您的 map。 This should solve ur issue.这应该可以解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.