1、当鼠标在地图上移动时,显示鼠标经过地点的经纬度坐标?
MyMap.MouseMove += new System.Windows.Input.MouseEventHandler(MyMap_MouseMove);
void MyMap_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
{
this.cor.Text = MyMap.ScreenToMap(e.GetPosition(MyMap)).ToString();
}
2、当放大或缩小地图时,触发视野改变事件,获取地图当前的比例尺、中心点坐标和当前视野数值?
MyMap.ViewBoundsChanged += new System.EventHandler<SuperMap.Web.Mapping.ViewBoundsEventArgs>(MyMap_ViewBoundsChanged);
void MyMap_ViewBoundsChanged(object sender, SuperMap.Web.Mapping.ViewBoundsEventArgs e)
this.scale.Text = "Scale:" + MyMap.Scale.ToString();
this.center.Text = "Center:" + MyMap.Center.ToString();
this.viewbounds.Text = "ViewBounds:" + MyMap.ViewBounds.ToString();