是的,我在这里进行了研究,发现到目前为止只引用了 MarkerClusterer 插件,或使用 KML 或 Fusion 表层的指针。
这:https ://developers.google.com/maps/articles/toomanymarkers#markermanager 也是一本有趣的书。
我想这应该相对容易,不是吗?让我尝试用伪代码表达我在做什么:
WILE event: "drag the map"
get current viewport bounds
load ajax call to look up markers that are located inside current viewport
remove previously visible markers
add newly visible markers to the display
END WHILE
我不擅长正确的计算机科学编程类型的东西,并且在必要的结构上苦苦挣扎,以执行像这样不断更新标记数组的有效循环动作。
不知何故,我的直觉告诉我这可能是一种低效的方式——我应该以不同的方式处理这个问题吗?我想避免的是在拖动端更新标记数组。
谢谢你的帮助。