How to implment infowindow?

Mar 24, 2008 at 4:01 AM
Hi,

I am stuck with infowindow.
No matter what i do, i just can't show the content. When I click the marker, it opens a blank info window.

Here is my code

Dim mark As New GoogleMarker
Googlemap1.Markers.Add(mark)
mark.Address = "frankston australia"
mark.OpenInfoWindowHtml("<h1>hello world</h1>")

Please assist

Thx in advance
Coordinator
Mar 24, 2008 at 7:00 AM
Edited Mar 24, 2008 at 7:03 AM
Hi,

OpenInfoWindowHtml method is to force (just once) a client action of opening info window when page is loaded after a request.
It does not require marker to be clicked or whatsoever.
The standard way to add info window content is by setting Text property of the marker:
Dim mark As New GoogleMarker
mark.Address = "frankston australia"
mark.Text = "<h1>hello world</h1>"
Googlemap1.Markers.Add(mark)
You can add content for info window of a marker using the InfoWindowContent in the page markup, as well:
<artem:GoogleMap ID="GoogleMap1" runat="server" Width="530px" Height="500px" Latitude="42.1229" Longitude="24.7879"
    Zoom="4" EnableScrollWheelZoom="true" BorderStyle="Solid" BorderColor="#999999" BorderWidth="1" OnClientClick="addMarker">
    <Markers>
        <artem:GoogleMarker Latitude="42.1229" Longitude="24.7879" Title="Click on the marker" Text="BASI">
            <InfoWindowContent>
                <h1>
                    Info Window Content</h1>
                <p>
                    This is an info window content template.</p>
            </InfoWindowContent>
        </artem:GoogleMarker>
    </Markers>
</artem:GoogleMap>

Please, note in the example above (page markup), I have set Text property of the marker and InfoWindowContent as well.
In that case InfoWindowContent will override the Text property for the content of marker's info window.

Hope this helps
Regards