Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you make multiple overlapping markers in Google Maps open their own infowindow when one is clicked

I am using Google Maps API V3 in javascript. I have multiple markers that are in a close proximity to each other. I want to make it so that when a user clicks a marker the infowindow of that marker and any markers overlapping it will open (I need to bubble the event click to all the other markers that overlap the clicked pixel). I can get the infowindow of the highest z-indexed marker to open, but I need to open the windows of the markers underneath too. Can this be done, and if so how?

like image 324
Boundless Avatar asked Nov 20 '11 22:11

Boundless


People also ask

How do I put InfoWindow on marker?

Call setPosition() on the info window, or. Attach the info window to a new marker using the InfoWindow. open() method. Note: If you call open() without passing a marker, the InfoWindow will use the position specified upon construction through the InfoWindowOptions object literal.

How many markers can Google Maps handle?

2048 characters in URL is just under 100 GeoCode values. So, again no more than 100 markers.


1 Answers

Try OverlappingMarkerSpiderfier

https://github.com/jawj/OverlappingMarkerSpiderfier

There is a demo here - http://jawj.github.com/OverlappingMarkerSpiderfier/demo.html

It attempts to give the same 'clustering' behaviour as the Earth Api.

like image 186
Fraser Avatar answered Oct 31 '22 17:10

Fraser