gpt4 book ai didi

ionic-framework - ionic Mapbox GeolocateControl : trackUserLocation?

转载 作者:行者123 更新时间:2023-12-05 07:22:47 24 4
gpt4 key购买 nike

我不知道如何通过 GPS 跟踪用户位置。

我可以将此代码添加到我的 Mapbox 中:

const geolocate = (new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true
},
trackUserLocation: true
}));
map.addControl(geolocate)

但在 iOS 中不显示。该怎么办?也许添加一些 Ionic/Cordova 技巧?

最佳答案

也许这有帮助:

Not all browsers support geolocation, and some users may disable the feature. Geolocation support for modern browsers including Chrome requires sites to be served over HTTPS. If geolocation support is not available, the GeolocateControl will not be visible.

来自:

https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol

关于ionic-framework - ionic Mapbox GeolocateControl : trackUserLocation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56409172/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com