Question

So I am trying to think of a way to facilitate two things. It may end up being a two step process in the end but I was looking for input.

The first thing I need to do is accommodate locations with the same address. The two scenarios that come to mind are businesses that share a location and apartment buildings.

The second thing I need to accommodate is a business/nonprofit with no headquarters, just a town. Right now I just map them to the town center, but if multiple businesses have no headquarters I run into the first problem.

So I did some Googling and found a solution that involved having a list of locations alongside the map so you can click on them and the info window will pop up. This isn't a solution for me though.

What I was thinking of was using the location to map the first point. For the second and points after that moving the marker over .05 degrees or something marginal so that the marker shows up. The inherent problem with that is that what happens if 12 Main Street turns into 13 Main Street?

So any thoughts on what I could do?

Thanks
Levi

Was it helpful?

Solution

There's an extension by Martin Pearman called ClusterMarker that detects any groups of two or more markers whose icons visually intersect when displayed. Each group of intersecting markers is then replaced with a single cluster marker that looks different. The cluster marker, when clicked, simply centres and zooms the map in on the markers whose icons previously intersected.

OTHER TIPS

A more advanced approach to this problem might be SQL - same address = same coordinates...

GROUP BY or HAVING COUNT > 1 ... would let you create multi-record coordinates.

In fact - before you can cluster client-side, you need to send out the data first, which means transferring much more than required in this case, which results in higher loading times and higher RAM utilization client-side ...plus all the useless JS processing of the clusterer.

Client-side clustering is only recommend when the coordinates are close to each other, but not when they are absolutely identical.

Think about it...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top