本文介绍了地理位置:仅移动谷歌地图标记而不重新加载地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我只需要在设备移动或设备变得更准确时更新标记.当位置变化时也重新加载地图,我只需要移动制造商.我有以下代码:
I need to update only the marker when the device is moving or when the device is getting more accuracy. When the position change also reload the map and I need to move only the maker. I have the following code:
谢谢!
推荐答案
我认为问题在于你在 watchPosition 函数中创建了一个新地图.您只需要创建一个标记,然后在 watchPosition 函数中更新其位置.
I believe that the problem is that you create a new map inside the watchPosition function. You only need to create one marker and then update its position inside the watchPosition function.
也许这个例子会对你有所帮助:
Maybe this example will help you:
这篇关于地理位置:仅移动谷歌地图标记而不重新加载地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!