This project is read-only.

Open info window on map load

Apr 20, 2008 at 3:18 PM
Hello valio,

I could populate my infowindow with the Infowindowcontent, but i want to open the infowindow on page load rather than
on mouse click, can you please suggest me ?

waiting for the fruitful response.

THanks and Regards

Kranthi Reddy
Apr 20, 2008 at 8:59 PM
Hi,
You shold use OpenInfoWindowHtml method of GoogleMarker.
This is a method which have to be call on the server-side.
Let's say you have GoogleMap control with ID="GoogleMap1", and you have added a marker to it.
Then you can call OpenInfoWindowHtml in Page_Load for example.
GoogleMap1.Markers[0].OpenInfoWindowHtml("This is a content to be opened over the marker when map is loaded");
, or
GoogleMarker marker = new GoogleMarker(LATITUDE, LONGITUDE);
marker.OpenInfoWindowHtml("This is a content to be opened over the marker when map is loaded");
GoogleMap1.Markers.Add(marker);

The purpose of that method is exactly you need: to invoke from server side code a info window, with specific content, to be opened over a marker after map is loaded.

Hope this helps.
Regards