原文 http://www.dotblogs.com.tw/justforgood/archive/2012/05/10/72085.aspx
先来看看完成后的画面,我从桃园画到*,再由*画到香港
Silverlight这边如下
我们在画面上新增一个线型的Symbol
程式码内如下
01 |
'Create by maggiore 2012/5/10 for dotblog
|
06 |
Dim g_graphic_airport As GraphicsLayer '宣告一个图层物件变数
|
09 |
g_graphic_airport = TryCast(MyMap.Layers( "graphic_airport" ), GraphicsLayer)
|
11 |
Dim pGraphic As Graphic = New Graphic() 'Imports ESRI.ArcGIS.Client
|
13 |
Dim Point As New MapPoint 'Imports ESRI.ArcGIS.Client.Geometry
|
19 |
Dim Point2 As New MapPoint 'Imports ESRI.ArcGIS.Client.Geometry
|
25 |
Dim Point3 As New MapPoint 'Imports ESRI.ArcGIS.Client.Geometry
|
32 |
Dim pPolyline1 As ESRI.ArcGIS.Client.Geometry.Polyline = New ESRI.ArcGIS.Client.Geometry.Polyline()
|
34 |
Dim pPointCollection1 As ESRI.ArcGIS.Client.Geometry.PointCollection = New ESRI.ArcGIS.Client.Geometry.PointCollection()
|
36 |
pPointCollection1.Add(Point)
|
37 |
pPointCollection1.Add(Point2)
|
38 |
pPointCollection1.Add(Point3)
|
40 |
pPolyline1.Paths.Add(pPointCollection1)
|
42 |
pGraphic.Geometry = pPolyline1
|
44 |
pGraphic.Symbol = Line_black
|
46 |
g_graphic_airport.Graphics.Add(pGraphic)
|
上述三个地点,小马在专案中是用for 回圈去捞资料库的资料,上面是为了让读者清楚简单了解,
才一个点一个点的示范喔!。
到这,读者应该可以明白之前小马是怎么耍白痴学食神在画面画个"赢"字了吧!(点或线皆可)