I m using the ASP.NET control from reimers.dk and I was able to view the map, add zoom/pan controls. Panning and zooming work fine from within the map. My problem is getting the map to center on a point sent from ASP.NET, like from a button click. There is no effect or change to the map. Any help with this is appreciated.
Here is the page and code behind:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register assembly="Reimers.Google.Map" namespace="Reimers.Google.Map" tagprefix="Reimers" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<Reimers:Map ID="Map1" runat="server" Width="600" Height="400" DefaultMapType="Terrain">
<Center Latitude="51.477" Longitude="0.0" />
</Reimers:Map>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
//////////////////////////////////////
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Map1.MapControls.Add(new Reimers.Google.Map.Controls.ZoomControl());
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Map1.SetCenter(new Reimers.Google.Map.LatLng(27, -82));
}
}
我也尝试了,没有这种控制。 我得出同样的结果。
Thank you in advance.