问题描述
我使用 React-Native-Maps
并且当我点击它们时,我的相互重叠的地图标记销会优雅地弹开,所以我可以选择想要的吗?
我已经将
有一些库可以做到这一点,但通常是通过调整缩放级别来实现的.这是一个可能的解决方案,还是您需要在当前缩放级别下将图钉分开?
如果您想在当前缩放级别将它们分开,它们可能会推入其他引脚并使问题变得更糟.您最好围绕获取点击事件的任何引脚进行边界框搜索,然后打开一个弹出窗口以从框中的任何结果中进行选择.
I use React-Native-Maps
and my map marker pins that overlap each other spring apart gracefully when i click them, so can i pick the one wanted?
I've used This library for the web side.
There are libraries that do this but normally it is implemented by adjusting the zoom level. Is that a possible solution or do you need to move the pins apart at the current zoom level?
If you want to move them apart at the current zoom level they could push into other pins and make the issue worse. You might be better off doing a bounding box search around whatever pin gets the click event and opening a popup to make a selection from any results in the box.
这篇关于React Native Maps Overlapping Marker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!