此代码不起作用
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitializeServerSide(); 配置客户端();} }
private void InitializeServerSide()
{
GLatLng latlng = new GLatLng(39, -0.5);
GMarker marker = new GMarker(latlng);
GMap1.Add(marker);
InitializeClientSide(marker.ID);
}
private void InitializeClientSide(string markerId)
{
btnGInfoWindow.Attributes.Add("onclick", string.Format("windowMe("+ markerId +");"));
}
private void ConfigureClientSide()
{
string js = string.Format(@"function windowMe(markerId){{var marker = getGMapElementById(subgurim_GMap1,markerId); marker.openInfoWindowHtml('Hello world!'); }}", GMap1.GMap_Id);
GMap1.addCustomJavascript(js);
}