<
UserControl x:Class
=
"
SilverlightApplication1.MainPage
"
xmlns
=
"
http://schemas.microsoft.com/winfx/2006/xaml/presentation
"
xmlns:x
=
"
http://schemas.microsoft.com/winfx/2006/xaml
"
xmlns:d
=
"
http://schemas.microsoft.com/expression/blend/2008
"
xmlns:mc
=
"
http://schemas.openxmlformats.org/markup-compatibility/2006
"
mc:Ignorable
=
"
d
"
d:DesignHeight
=
"
300
"
d:DesignWidth
=
"
400
"
xmlns:esri
=
"
http://schemas.esri.com/arcgis/client/2009
"
>
<
Grid x:Name
=
"
LayoutRoot
"
Background
=
"
White
"
>
<
esri:Map x:Name
=
"
MyMap
"
MouseMove
=
"
MyMap_MouseMove
"
ExtentChanged
=
"
MyMap_ExtentChange
"
ExtentChanging
=
"
MyMap_ExtentChange
"
>
//一个mouse移动触发函数,二个地图范围改变时触发函数
<
esri:ArcGISTiledMapServiceLayer ID
=
"
MyLayer
"
Url
=
"
http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_ShadedRelief_World_2D/MapServer
"
/>
</
esri:Map
>
<
Canvas Width
=
"
225
"
Height
=
"
90
"
HorizontalAlignment
=
"
Right
"
VerticalAlignment
=
"
Top
"
Margin
=
"
0,15,15,0
"
>
<
Rectangle Stroke
=
"
Gray
"
RadiusX
=
"
10
"
RadiusY
=
"
10
"
Fill
=
"
#775C90B2
"
Canvas.Left
=
"
0
"
Canvas.Top
=
"
0
"
Width
=
"
225
"
Height
=
"
90
"
>
<
Rectangle.Effect
>
<
DropShadowEffect
/>
</
Rectangle.Effect
>
</
Rectangle
>
<
Rectangle Fill
=
"
#FFFFFFFF
"
Stroke
=
"
DarkGray
"
RadiusX
=
"
5
"
RadiusY
=
"
5
"
Canvas.Left
=
"
10
"
Canvas.Top
=
"
10
"
Width
=
"
205
"
Height
=
"
70
"
/>
<
TextBlock x:Name
=
"
ExtentTextBlock
"
Text
=
"
Extent:
"
Margin
=
"
20,14,15,0
"
TextWrapping
=
"
Wrap
"
FontWeight
=
"
Bold
"
/> //ExtentTextBlock显示地图范围
</
Canvas
>
<
Grid Width
=
"
355
"
Height
=
"
65
"
HorizontalAlignment
=
"
Right
"
VerticalAlignment
=
"
Top
"
Margin
=
"
0,111,0,0
"
>
<
Rectangle Stroke
=
"
Gray
"
RadiusX
=
"
10
"
RadiusY
=
"
10
"
Fill
=
"
#775C90B2
"
Margin
=
"
0,0,0,6
"
>
<
Rectangle.Effect
>
<
DropShadowEffect
/>
</
Rectangle.Effect
>
</
Rectangle
>
<
Rectangle Fill
=
"
#FFFFFFFF
"
Stroke
=
"
DarkGray
"
RadiusX
=
"
5
"
RadiusY
=
"
5
"
Margin
=
"
10,10,10,15
"
/>
<
StackPanel Canvas.Left
=
"
20
"
Canvas.Top
=
"
14
"
Margin
=
"
20,14,10,0
"
>
<
TextBlock x:Name
=
"
ScreenCoordsTextBlock
"
//ScreenCoordsTextBlock显示屏幕坐标
HorizontalAlignment
=
"
Left
"
VerticalAlignment
=
"
Center
"
Text
=
"
Screen Coords:
"
TextWrapping
=
"
Wrap
"
FontWeight
=
"
Bold
"
/>
<
TextBlock x:Name
=
"
MapCoordsTextBlock
"
//MapCoordsTextBlock显示地图坐标
HorizontalAlignment
=
"
Left
"
VerticalAlignment
=
"
Center
"
Text
=
"
Map Coords:
"
TextWrapping
=
"
Wrap
"
FontWeight
=
"
Bold
"
/>
</
StackPanel
>
</
Grid
>
</
Grid
>
</
UserControl
>