我发现 LeafletJS map 存在一个问题,即该 map 向东和向西是连续(无限)的。但是,它不能正确处理标记位置。当我设置一个标记并将焦点放在该标记上时,我肯定会在正确的位置看到它。但是,当我将 map 绕其轴旋转 1 倍并到达完全相同的位置时,标记不在那里。
例如,当洛杉矶的某人向西平移到澳大利亚悉尼查看他的标记时,该标记不会出现,这是一个问题。他必须一路向东平移才能看到标记。有什么解决办法吗?
最佳答案
启用worldCopyJump创建 map 时的选项。
worldCopyJump
Boolean false
With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.
关于javascript - LeafletJS 处理连续 map 上的标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38022976/