Search code examples
javascriptjquery-gmap

Show multiple infowindow at once in gMap


From the author's website, let's say we have multiple markers:

$("#map1").gMap({ markers: [{ latitude: 47.660937,
                              longitude: 9.569803,
                              html: "Tettnang, Germany",
                              popup: true }],
                  zoom: 6 });

$("#map2").gMap({ markers: [{ latitude: 47.660940,
                              longitude: 9.569803,
                              html: "Tettnang, Germany",
                              popup: true }],
                  zoom: 6 });
$("#map3").gMap({ markers: [{ latitude: 47.660946,
                          longitude: 9.569803,
                          html: "Tettnang, Germany",
                          popup: true }],
              zoom: 6 });

We use popup: true to show the infowindow by default when the map is loaded. But only the last infowindow (#map3) is shown. Others remain just a marker.

How do I make all infowindow to popup at once? Thanks.


Solution

  • As pointed on the Google Map API page, only one InfoWindow may be displayed at one time (at least with V2)

    Best alternative I've found so far is this library called elabel.js which can be used to add labels to the map