最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - OverlappingMarkerSpiderfier offset length for markers - Stack Overflow

programmeradmin1浏览0评论

Background
I use google maps together with clustermarkererplus to display various markertypes with infobubbles on a map. To deal with markers with exactly the same coordinate (or very close) an offset is generated for the markers that overlap by using OverlappingMarkerSpiderfier (OMS). Searching for an answer to this has so far only led me to adjustment of the thickness of the offset lines.

Problem
When there are many markers the offset given by the OMS is too small.

Questions

  • How can I increase the offset (leg length)?
  • Can it be dependent on if the number of markers separated by the OMS is more than a certain value?

Example (to show the effect)
Visualisation of what I want to do, increase offset (leg length)

Code
Documentation of OMS is available at: //Options I use
options = {keepSpiderfied:true};

//Creation of the OMS
new OverlappingMarkerSpiderfier(map, options);

//Click listener
oms.addListener('click', function(marker, event) {
//Code for showing infowindows
});

//Adding marker
oms.addMarker(marker);

Background
I use google maps together with clustermarkererplus to display various markertypes with infobubbles on a map. To deal with markers with exactly the same coordinate (or very close) an offset is generated for the markers that overlap by using OverlappingMarkerSpiderfier (OMS). Searching for an answer to this has so far only led me to adjustment of the thickness of the offset lines.

Problem
When there are many markers the offset given by the OMS is too small.

Questions

  • How can I increase the offset (leg length)?
  • Can it be dependent on if the number of markers separated by the OMS is more than a certain value?

Example (to show the effect)
Visualisation of what I want to do, increase offset (leg length)

Code
Documentation of OMS is available at: https://github./jawj/OverlappingMarkerSpiderfier //Options I use
options = {keepSpiderfied:true};

//Creation of the OMS
new OverlappingMarkerSpiderfier(map, options);

//Click listener
oms.addListener('click', function(marker, event) {
//Code for showing infowindows
});

//Adding marker
oms.addMarker(marker);

Share Improve this question edited Jan 18, 2016 at 21:52 Matthias Tidlund asked Jan 17, 2016 at 13:14 Matthias TidlundMatthias Tidlund 17811 bronze badges 3
  • Please provide a Minimal, Complete, Tested and Readable example that demonstrates the issue. – geocodezip Commented Jan 17, 2016 at 18:31
  • looks to me like you want: circleSpiralSwitchover (default: 9), "This is the lowest number of markers that will be fanned out into a spiral instead of a circle. Set this to 0 to always get spirals, or Infinity for all circles.". But you haven't provided an example so we can see what you are seeing. – geocodezip Commented Jan 17, 2016 at 19:45
  • @geocodezip , I have now changed my example to a picture and hopefully it is easier to see in that one what offset I want to increase. I want the markers further out from the center no matter if a spiral or a circle is generated. – Matthias Tidlund Commented Jan 18, 2016 at 22:01
Add a ment  | 

2 Answers 2

Reset to default 9

OverlappingMarkerSpiderfier has adjustable offset (leg length) by specifying two different options:

  1. circleFootSeparation: "default:23" (Offset from the center of the circle)
  2. spiralLengthFactor:"default:4" (Value proportional to the offset from the spiral center)

Angular separation can also be adjusted for the spiral
spiralFootSeparation:"default:26"

I'm not familiar with OverlappingMarkerSpiderfier, so just did some research and found this tutorial. It also include 'legWeight' which determine the thickness of the lines joining spiderfied markers to their original locations.

Here's the link for Overlapping Marker Spiderfier: https://github./jawj/OverlappingMarkerSpiderfier

I hope it might help you.

发布评论

评论列表(0)

  1. 暂无评论