gpt4 book ai didi

javascript - 带有带有大量 geojson 数据的传单标记簇的 Mapbox

转载 作者:行者123 更新时间:2023-11-28 00:16:50 28 4
gpt4 key购买 nike

我正在使用 mapbox 在 map 上绘制集群。

我正在遵循这个例子。 https://www.mapbox.com/mapbox.js/example/v1.0.0/markercluster-multiple-groups/

在此示例中,geojson 文件有 86 条记录

https://www.mapbox.com/mapbox.js/assets/data/stations.geojson处理这些数据效果很好。

但是当我加载包含 1000 条记录的 geojson 文件时,它给出了以下错误。

"A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue. Script: https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.js:4".

请就此提出建议。

谢谢!!

最佳答案

尝试将 geojson 转换为 topojson,它可以帮助提高性能。

http://jeffpaine.github.io/geojson-topojson/

或命令行:

https://github.com/mbostock/topojson/wiki/Command-Line-Reference

关于javascript - 带有带有大量 geojson 数据的传单标记簇的 Mapbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30394937/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com