gpt4 book ai didi

mapbox - 多个标记 - 相同的坐标

转载 作者:行者123 更新时间:2023-12-03 12:54:52 24 4
gpt4 key购买 nike

我在尝试显示放置在完全相同坐标处的 2 个不同标记时遇到了一些麻烦。

情况是:我们正在展示商店,其中一些商店位于同一建筑物(即商场),因此,它们是不同的商店,但共享相同的泛化/坐标。

我们的 json 源内容如下所示:

  {
"properties" : {
"id" : "1",
"name" : "Store 1"
},
"geometry" : {
"coordinates" : [-70.66667, -33.45],
"type" : "Point"
}
},
{
"properties" : {
"id" : "2",
"name" : "Store 2"
},
"geometry" : {
"coordinates" : [-70.66667, -33.45],
"type" : "Point"
}
}

问题是,只有其中一个被显示。

我的问题是,这个用例有开箱即用的解决方案吗?还是我们应该实现我们自己的解决方案?

提前致谢!

最佳答案

如果您使用的是 Marker来自 mapbox-gl 的类,你可以只应用标准 CSS transform偏移标记。

另一种解决方案是称为“蜘蛛标记”的东西:

  • https://bewithjonam.github.io/mapboxgl-spiderifier/docs/index.html
  • https://github.com/bewithjonam/mapboxgl-spiderifier
  • 关于mapbox - 多个标记 - 相同的坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47273555/

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