我有以下设置,我想做的是在移动地图时更新标记:
https://gist.github.com/277894809fe04cbc29c7
json端点返回例如:
[{"_id":"4ecc19ca8de17b2f0f000001","latitude":47.413358,"location":[47.413358,9.744583],"longitude":9.744583,"name":"d2"},{"_id":"4ecc14e68de17b2924000001","latitude":47.413417,"location":[47.413417,9.744417],"longitude":9.744417,"name":"another"}]
但是移动地图时出现以下错误:
Uncaught RangeError: Maximum call stack size exceeded
I.get
a.(anonymous function)
tB.(anonymous function).zoomRange_changed
mf
I.set
(anonymous function)
tB.(anonymous function).zoomRange_changed
mf
I.set
......
不知道是什么原因造成的,我把各种来源的样本放在一起,不得不进行很多调整,因为方法等似乎发生了很大变化。
不知道我是否错过了什么,如果有人可以给我指点我会很高兴
非常感谢,
克里斯多夫
最佳答案
在您的json中,您应该将longitude
替换为lng
,将latitude
替换为lat
。
但是我应该更改代码,以避免在参数格式错误时出现此类奇怪的意外。