This project is read-only.

How to implment infowindow?

Mar 24, 2008 at 5:01 AM

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
mark.Address = "frankston australia"
mark.OpenInfoWindowHtml("<h1>hello world</h1>")

Please assist

Thx in advance
Mar 24, 2008 at 8:00 AM
Edited Mar 24, 2008 at 8:03 AM

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>"
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">
        <artem:GoogleMarker Latitude="42.1229" Longitude="24.7879" Title="Click on the marker" Text="BASI">
                    Info Window Content</h1>
                    This is an info window content template.</p>

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