天天看點

SuperMap iClient for Silverlight開發筆記(不斷補充中)

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();

繼續閱讀