When it comes to mapping, here at Plank we’ve come to lean on the wonderful php-google-map-api class.
One of the projects we’ve recently been working on is Culture Days. It’s a project to have a weekend this fall across Canada where people can participate in a variety of free, locally-organized cultural events. Naturally, we wanted to show a map displaying all the locations of various events around the country.
One issue we were encountered is what happens when there are many events all going on in the same area throughout the day. At certain zoom levels, we ended up with an unusable mess of markers. This is where the excellent MarkerClusterer comes to the rescue.
Yet one issue still remained. In many cases, there were a lot of events happening throughout the day at one specific location. For example, up in Flin Flon, Manitoba, there are 11 events going on throughout the day at the Flin Flon School & Community Center. No matter how much you zoom into the map, you would still end up with 11 markers, all stacked one on top of the other, unable to get information on any event besides the top one. This would not do.
So, we added the functionality we needed - the ability to show the information of all Markers in a Cluster once you are zoomed closer than a certain level. You can see it in action on Manitoba.
In the interest of helping those in the same boat as us, we’ve put our changes to those libraries up on our github account. For more technical information about the changes we did, view the readme’s in their respective repos.