Hi all
I'd like to make the info window opened on initial load, and bind it so that everytime user click on the marker, the same info window will open.
Below is my current approach.
If you have any smarter approaches, please let me know. Thanks.
// Create the Gothere map object.
var map = new GMap2(document.getElementById("map"));
// Create a geocoder.
var geocoder = new GClientGeocoder();
// Send a geocoding request.
geocoder.getLatLng("{name}", function(latlng) {
//console.log(latlng);
if (latlng) {
// Set the center of the map.
map.setCenter(latlng, 17);
// Add a marker to the map.
marker = new GMarker(latlng);
map.addOverlay(marker);
marker.openInfoWindowHtml("<h3>{name}</h3>" +
"<p>{address} {postalcode}</p>",
{maxWidth:200});
marker.bindInfoWindowHtml("<h3>{name}</h3>" +
"<p>{address} {postalcode}</p>",
{maxWidth:200});
}
});