gpt4 book ai didi

google-maps - watchPosition() 和 getCurrentPosition

转载 作者:行者123 更新时间:2023-12-02 07:38:51 24 4
gpt4 key购买 nike

getCurrentPosition()watchPosition() 有什么区别。我阅读了几篇关于 getCurrentPosition()watchPosition() 的文章。但我都不清楚。据我所知,getCurrentPosition() 只更新一次位置,但 watchPosition() 会连续更新位置。我对不对??

最佳答案

getCurrentPosition() 给出 currentPosition 纬度和经度值,它只触发一次。其中 watchPosition() 连续给出 currentPosition 纬度和经度值。如果位置发生变化(假设你在移动的车辆中,那么 watchPosition() 将给出结果。然后你会知道这个结果)

关于google-maps - watchPosition() 和 getCurrentPosition,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13324165/

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