📜  传单找到最近的标记 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:33.403000             🧑  作者: Mango

代码示例1
Leaflet.GeometryUtil is the best solution I found for that (https://github.com/makinacorpus/Leaflet.GeometryUtil). Use L.GeometryUtil.closestLayer.

It's more practical to use than leaflet-knn because you can send an array of layers (markers for examples), instead of only a geojson layer. But more importantly, it seems faster (about 90% faster with a set of 500+ markers, cold start, on Chrome 36, although on FF31 it's comparable)