Hello everyone,
I am trying to integrate ExtInfoWindow into my GoogleMap application which is using the Google Map control, but not lucky. Having an error occured and I could not find out the way to solve it. Now I post my problem here and hope someone can help me to solve it. Jacob, can you help me?
_ Demo : http://googlemapsapi.blogspot.com/2007/12/extinfowindow-10-ajax-powered-css.html
_ Source and example : http://gmaps-utility-library.googlecode.com/svn/trunk/extinfowindow/release/docs/examples.html
I wrote some code into Maploaded event like as following :
protected void GMap_MapLoaded(object sender, Reimers.Map.BoundsEventArgs e)
{
string CommandStr = "var marker = new GMarker(new GLatLng(44, -96));";
CommandStr += "GEvent.addListener(marker, 'click', function(){";
CommandStr += "marker.openExtInfoWindow(";
CommandStr += "reimers.map." + GMap.ClientID + ",";
CommandStr += " 'simple_example_window',";
CommandStr += " 'Im some HTML content that will go in the simple examples ExtInfoWindow.',";
CommandStr += "{beakOffset: 3});});";
CommandStr += "reimers.map."+GMap.ClientID+".addOverlay(marker);";
e.MapCommand = CommandStr;
}
and did not forget to add the ExtInfoWindow library :
protected override void OnLoadComplete(EventArgs e)
{
base.OnLoadComplete(e);
HtmlHead header = Page.Header;
HtmlForm from = Page.Form;
HtmlGenericControl script = new HtmlGenericControl();
script.TagName = "script";
script.Attributes.Add("type", "text/javascript");
script.Attributes.Add("src", "../extinfowindow.js");
from.Controls.Add(script);
script = new HtmlGenericControl();
script.TagName = "link";
script.Attributes.Add("type", "text/css");
script.Attributes.Add("rel", "Stylesheet");
script.Attributes.Add("media", "screen");
script.Attributes.Add("href", "redInfoWindow.css");
header.Controls.Add(script);
}
redInfoWindow.css :
#simple_example_window{
width: 300px;
}
#simple_example_window_contents{
background-color: #FFF;
border: 3px solid #900;
}
#simple_example_window_beak{
width: 28px;
height: 38px;
background: url('../images/corners/simple_beak.png') top left no-repeat transparent;
}
* html #simple_example_window_beak{
/* Alpha transparencies hack for IE */
background-image:none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/corners/red_beak.png', sizingMethod='crop');
}
#simple_example_window_tl, #simple_example_window_tr, #simple_example_window_bl, #simple_example_window_br,
#simple_example_window_t,#simple_example_window_l,#simple_example_window_r,#simple_example_window_b{
height: 0px;
width: 0px;
}
The marker was showed on the map, but when I clicked on the marker an error occuring which told me that "Message: Object doesn't support this property or method" and the InfoWindow was not displayed. Please give me some advice. Thanks in advance.