简体   繁体   English

Delphi Android TMapView 在首次启动时未显示“当前位置”按钮

[英]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?导致当前位置按钮在第一次启动时不显示的原因可能是什么?

图像1 img2

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.

相关问题 TMapView 一开始不显示当前位置 - TMapView not showing the current location at the beginning 在Android上获取当前位置-当前仅在首次启动应用时崩溃[广播错误] - Getting Current Location on Android - Currently crashing only on first app launch [Broadcast error] 没有打开位置不显示Android中的当前位置 - without turn on location not showing current location in android GPS提供商第一次不显示当前位置 - GPS provider not showing current location at first time 我的 Android 手机上未完全加载 Google 地图,但显示了我当前的位置按钮和放大/缩小按钮 - Google map is not fully loaded on my android phone but my current location button and zoom in/zoom out button are showing 仅在Android首次启动时显示设置屏幕 - Showing the setup screen only on first launch in android Google地图片段未显示当前位置按钮 - Google Map fragment not showing current location button 当前位置未显示在我的 android 应用中 - Current location is not showing in my android app 检查首次启动android时是否在活动上单击了一个按钮 - Check if a button is clicked on an activity on first launch android 先平移,然后缩放到Android中的当前位置 - Pan first, then zoom to current location in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM