阅读:1967回复:4
mapobject第三贴
<H1 >第二章</H1>
<P >使用地图和图层</P> <P >使用<FONT face="Times New Roman">MapObjects</FONT>的起点就是向应用程序中加入地图并向地图中加入数据。</P> <P >向应用程序中加入地图十分简单,只需把工具箱中的地图控件加道<FONT face="Times New Roman">VB</FONT>的表单中,象其它控件一样,你可调整它的大小和位置,并可同过<FONT face="Times New Roman">VB</FONT>的属性窗口或地图控件属性窗口来改变属性。</P> <P >通过地图控件属性窗口加入形文件十分方便,当你在应用程序中使用<FONT face="Times New Roman">MapObjects</FONT>时,还会发现使用图层是十分必要的。</P> <P >最初,你会对向地图中加入图层感到不适应,你不得不研究大量的<FONT face="Times New Roman">OLE Automatiion objects</FONT>、<FONT face="Times New Roman">SDE</FONT>层和影像文件。但渐渐你会发现<FONT face="Times New Roman">MapObjects</FONT>的数据通道和地图显示目标具有极大的灵活性和多功能性。</P> <P >本章将涉及以下内容:</P> <P >§ 如何在地图上表示层。</P> <P >§ 层的次序。</P> <P >§ 向地图中加入形文件。</P> <P >§ 向地图中加入图像文件。</P> <P >§ 建立地图用户接口。</P> <P >§ 设置地图属性。</P> <P >§ 数据连接。</P> <P >§ 修改图层。</P> <P >§ 动态跟踪层。</P> <P >本章将涉及以下目标:</P> <P ><FONT face="Times New Roman">GeoDatasets</FONT>集、<FONT face="Times New Roman">DataConnection</FONT>目标、<FONT face="Times New Roman">GeoDataset</FONT>目标、地图控件、图层集、图层目标、影像层目标、动态跟踪层目标、<FONT face="Times New Roman">GeoEvent</FONT>目标。</P> <P >使用<FONT face="Times New Roman">MapObjects</FONT>向地图中添加数据有三种方式:</P> <P >§ 通过建立<FONT face="Times New Roman">DataConnection</FONT>、<FONT face="Times New Roman">GeoDataset</FONT>和图层目标及向地图目标的层集中添加数据的方法加入矢量地图数据。</P> <P >§ 通过建立影像层目标及向地图目标的层集中影像层的方法显示影像地图数据以作背景。</P> <P >§ 通过使用动态跟踪层目标和添加<FONT face="Times New Roman">GeoEvent</FONT>目标的方法实现动态跟踪。</P> <P >在地图上画层</P> <P >地图包含许多层。现在我们要讨论<FONT face="Times New Roman">MapObjects</FONT>的各种层目标和如何在地图控件中管理图层。</P> <P >用户眼中的图层</P> <P >地图的最上方是动态跟踪层,最下方为地图控件,中间为层集。层集中图层目标和影像层目标可以任意顺序排放,但通常影像层显示在最底层作为背景。</P> <P >以层方式工作十分有意,因为它十你很容易的选取同类地物。</P> <P >程序员眼中的层</P> <P >以下是影响显示地图数据的关键目标:</P> <P >§ 地图控件是显示图层的平台,它有两个重要的属性:层集和动态跟踪层目标。</P> <P >§ 层集包含图层目标和动态跟踪层目标。它们的顺序决定在地图控件中的相互覆盖关系。</P> <P >§ 图层目标代表矢量数据。</P> <P >§ 影响层目标代表栅格数据。</P> <P >§ 动态跟踪层目标显示实时数据。</P> <P >地图控件的关键属性是层和跟踪层。当你向表单中假如一地图控件,你也同时建立了一个空层和空跟踪层。</P> <P >另一重要属性是<FONT face="Times New Roman">Extent</FONT>。它决定地图的显示范围。</P> <P >用<FONT face="Times New Roman">Refresh</FONT>方法在地图控件上画层。当你执行下列操作时<FONT face="Times New Roman">Refresh</FONT>方法将自动执行:</P> <P >§ 向层集中加入图层或影像层。</P> <P >§ 使用<FONT face="Times New Roman">Pan</FONT>和<FONT face="Times New Roman">CenterAt</FONT>方法。</P> <P >§ 更新地图控件的<FONT face="Times New Roman">Extent</FONT>属性。</P> <P >§ 使用<FONT face="Times New Roman">Clear</FONT>或<FONT face="Times New Roman">Remove</FONT>方法。</P> <P >注意,有些操作不会引发<FONT face="Times New Roman">Refresh</FONT>方法,在编写程序时应在这些操作后加上<FONT face="Times New Roman">Refresh</FONT>方法一使操作更新显示。</P> <P >标准控件的属性和方法</P> <P >如果你是<FONT face="Times New Roman">VB</FONT>的用户,你应了解一些标准属性和方法:<FONT face="Times New Roman">Container</FONT>、<FONT face="Times New Roman">DragIcon</FONT>、<FONT face="Times New Roman">Index</FONT>、<FONT face="Times New Roman">Left</FONT>、<FONT face="Times New Roman">Height</FONT>、<FONT face="Times New Roman">Drag</FONT>、<FONT face="Times New Roman">Setfocus</FONT>等,这里我们还将介绍一些<FONT face="Times New Roman">Mapobjects</FONT>的专门属性。</P> <P >层集</P> <P >层集是地图控件的重要属性,包含图层和影像层。</P> <P >使用<FONT face="Times New Roman">Add</FONT>方法可向层集中加入图层或影像层,无论增加了图层还是影像层,<FONT face="Times New Roman">FullExtent</FONT>属性都会使地图撑满。</P> <P >如果你想使全图重新显示,可设置<FONT face="Times New Roman">Extent</FONT>属性为<FONT face="Times New Roman">FullExtent</FONT>。</P> <P >Set map1.Extent = map1.FullExtent<p></p></P> <P ><FONT face="Times New Roman">Clear</FONT>和Remove方法可删除层集中某层。例如:<p></p></P> <P >Map1.Layers.Remove (4)<p></p></P> <P ><FONT face="Times New Roman">MoveTo</FONT>、<FONT face="Times New Roman">MoveToBottom</FONT>和<FONT face="Times New Roman">MoveToTop</FONT>方法可改变层集中侧的顺序。</P> <P >层的表示可以有层名和索引两种方式。例如,下面的例子中索引号为<FONT face="Times New Roman">2</FONT>,层名名叫<FONT face="Times New Roman">Hydrography</FONT>:</P> <P >Map1.Layers.Item(2).Symbol.Color = vbBlue<p></p></P> <P >Map1.Layers(2).Symbol.Color = vbBlue<p></p></P> <P >Map1.Layers.Item("Hydrography").Symbol.Color = vbBlue<p></p></P> <P >Map1.Layers("Hydrography").Symbol.Color = vbBlue<p></p></P> <P >图层目标</P> <P >图层目标代表矢量数据。你可以下面的方式建立新层:</P> <P >Dim mLayer As New MapObjects。MapLayer<p></p></P> <P >当你通过<FONT face="Times New Roman">DataConnection</FONT>目标的<FONT face="Times New Roman">FindGeoDatase</FONT>t方法把图层加到<FONT face="Times New Roman">GeoDataset</FONT>目标中时,以下操作将自动执行:<p></p></P> <P >§ <FONT face="Times New Roman">Extent</FONT>属性被更新为地图的最大范围。</P> <P >§ <FONT face="Times New Roman">Records</FONT>属性被分配了一<FONT face="Times New Roman">Recordset</FONT>目标。</P> <P >§ <FONT face="Times New Roman">ShapeType</FONT>属性将依据形文件类型被设成<FONT face="Times New Roman">moPoint</FONT>、<FONT face="Times New Roman">moLine</FONT>、<FONT face="Times New Roman">moPolygon</FONT>。</P> <P >§ <FONT face="Times New Roman">Symbol</FONT>设为缺省,并随即赋予颜色。</P> <P >§ 如果<FONT face="Times New Roman">FindGeoDataset</FONT>方法成功,<FONT face="Times New Roman">Valid</FONT>属性将被设成<FONT face="Times New Roman">True</FONT>。</P> <P >§ <FONT face="Times New Roman">Visible</FONT>属性设成<FONT face="Times New Roman">True</FONT>。</P> <P ><FONT face="Times New Roman">Renderer</FONT>属性将设为<FONT face="Times New Roman">Nothing,</FONT>等待你设定其中的一个<FONT face="Times New Roman">Rerderer</FONT>目标:<FONT face="Times New Roman">ClassBreaksRenderer</FONT>、<FONT face="Times New Roman">ValueMapRenderer</FONT>、<FONT face="Times New Roman">DotDensityRenderer</FONT>或<FONT face="Times New Roman">LableRenderer</FONT>。<FONT face="Times New Roman">Maplayer</FONT>给你提供了一些强有力的方法以改变<FONT face="Times New Roman">Maplayer</FONT>的属性数据。这些将在第五章里讲述。</P> <P >影像层目标</P> <P >影像层目标表示你的层集中的一个图象文件。象图层目标一样,可以如此创立一个新影像层目标:</P> <P >Dim iLayer As New Mapobjects ImageLayer</P> <P >然后,你可在层集里用<FONT face="Times New Roman">Add</FONT>方法往你的地图画面里加入图象文件。你可能还要使用层集里的<FONT face="Times New Roman">MoveToBottom</FONT>方法,这样图象就不会挡住其它的层。</P> <P >当你将影像层附加图象文件时,<FONT face="Times New Roman">Extent</FONT>属性就会被更新,最大限度地反映地理范围。在同一地理坐标上,如果你想使用其它图层,图象文件应有一个相关的配准文件。</P> <P >反馈图层类型</P> <P >在层集里用<FONT face="Times New Roman">Add</FONT>方法加入图层或影像层,如方法成功<FONT face="Times New Roman">,</FONT>就会反回<FONT face="Times New Roman">True</FONT>。</P> <P >一旦层集里包括了一些层目标,你必须随时掌握各种层的类型。下面是在层集中返回层类型的例子:</P> <P >Dim Layer As objects<p></p></P> <P >For Each Layer In Map1.Layers<p></p></P> <P >If Layer.LayerType = moMapLayer Then<p></p></P> <P >MsgBook "layer" ; Layer.Name ; "is a map layer"<p></p></P> <P >ElseIf Layer.LayerType = moImageLayer Then<p></p></P> <P >MsgBook "layer" ; Layer.Name ; "is a image layer"<p></p></P> <P >End If<p></p></P> <P >Next Layer<p></p></P> <P >注意,我们必须将层声明为目标,这样<FONT face="Times New Roman">Visual Basic</FONT>可在运行时接受此定义。</P> <P >在上面例子中,还用到两个常量:<FONT face="Times New Roman">moMaplayer</FONT>和<FONT face="Times New Roman">moImagelayer</FONT>,这增加了程序的可读性。你可在<FONT face="Times New Roman">MapObjects</FONT>帮助屏上或在<FONT face="Times New Roman">MapObjects</FONT>程序员手册上查到所有常量的值。</P> <P >全面检查图层</P> <P >在上面例子的基础上,使用层集索引全面检查图层属性:</P> <P >Dim i As Integer<p></p></P> <P >For i = 0 To Map1.Layers.Count - 1<p></p></P> <P >If Map1.Layer(i).LayerType = moMapLayer Then<p></p></P> <P >If Map1.Layer(i).shapeType = moPoint Then<p></p></P> <P >MsgBook "Layer number" ; i ; "is a map layer and contains points."<p></p></P> <P >ElseIf Map1.Layer(i).shapeType = <st1:place w:st="on"><st1:City w:st="on">moLine</st1:City></st1:place> Then<p></p></P> <P >MsgBook "Layer number" ; i ; "is a map layer and contains lines."<p></p></P> <P >ElseIf Map1.Layer(i).shapeType = moPolygon Then<p></p></P> <P >MsgBook "Layer number" ; i ; "is a map layer and contains polygons."<p></p></P> <P >End If<p></p></P> <P >ElseIf Map1.Layer(i).LayerType = moImageLayer Then<p></p></P> <P >MsgBook "Layer number" ; i ; "is a image layer."<p></p></P> <P >End If<p></p></P> <P >Next i<p></p></P> <P >图层显示</P> <P >图层在地图控件中的显示顺序与其在层集中索引的顺序相反。</P> <P >新增图层的索引号总是<FONT face="Times New Roman">0</FONT>,以有图层的索引号按顺序递增。这与<FONT face="Times New Roman">VB</FONT>的一些集合有所不同。</P> <P >在地图控制单中<FONT face="Times New Roman">,Layers </FONT>是按<FONT face="Times New Roman"> Layers </FONT>集里索引值的例序排列来调用的<FONT face="Times New Roman">.</FONT></P> <P ><FONT face="Times New Roman">Drawing</FONT>事件</P> <P >当你在地图上调出图层后,一系列事件就会起动。你可将程序放到这些事件后面,并</P> <P >可让用户取消调出的大的地图层。</P> <P >当你在地图控件中使用<FONT face="Times New Roman">Refresh</FONT>方法<FONT face="Times New Roman">,</FONT>就会出现如下情况:</P> <P ><FONT face="Times New Roman">1. BeforeLayerDraw</FONT>事件起动。</P> <P ><FONT face="Times New Roman">2. </FONT>层集按索引相反顺序调出。</P> <P ><FONT face="Times New Roman">3. AfterLayerDraw</FONT>事件起动。</P> <P ><FONT face="Times New Roman">4. BeforeTrackingLayerDraw</FONT>事件起动。</P> <P ><FONT face="Times New Roman">5. </FONT>如果任何<FONT face="Times New Roman">GeoEvents</FONT>加入到<FONT face="Times New Roman">TrackingLayer</FONT>中,他们就被画出。</P> <P ><FONT face="Times New Roman">6. AfterTrackingLayerDrow</FONT>事件启动。</P> <P >这些<FONT face="Times New Roman">Drawing</FONT>事件的一个使用方法是往地图上画一些几何图形,如线、圆和在地图上说明注记,另一使用方法是调出层集或<FONT face="Times New Roman">TrackingLayer</FONT>之前来检验状态。</P> <P >如果你的用户在地图上已启动了一种方法,而它又占用了太长的时间,你可按<FONT face="Times New Roman">Escape</FONT>键取消操作。你可赋予地图控件的<FONT face="Times New Roman">CancelAction</FONT>属性以下三种值。</P> <P >§ <FONT face="Times New Roman">moCancelNone</FONT>是说按<FONT face="Times New Roman">Escape</FONT>键将被忽略。</P> <P >§ <FONT face="Times New Roman">moCancelMap</FONT>将停止所有层的调出。</P> <P >§ <FONT face="Times New Roman">moCancelLayer</FONT>将停止当前层的调出。</P> <P >按<FONT face="Times New Roman">Escape</FONT>键启动<FONT face="Times New Roman">DrawingCancelled</FONT>事件。将程序放到事件后,以便应用程序可通过恰当的方法处理绘图过程的末端。</P> <P >在你的应用程序中控制地图的调出速度的方法是在地图控件中设置<FONT face="Times New Roman">RefreshCount</FONT>属性。<FONT face="Times New Roman">Mapobjects</FONT>在缓冲器里调出地图,当达到一定矢量数目时更新地图显示。缺省情况下,此属性为<FONT face="Times New Roman">10,000</FONT>。降低这种特性在较慢的计算机上可能会明显提高效率,增加这种特性将加快一些地图控件的调出。</P> <P >利用<FONT face="Times New Roman">Win API</FONT>扩充<FONT face="Times New Roman">MapObjects</FONT>应用程序</P> <P ><FONT face="Times New Roman">MapObjects</FONT>提供了一种方法来使用经常出现在<FONT face="Times New Roman">Window</FONT>应用程序接口程序中的两个变量<FONT face="Times New Roman"> hDC</FONT>和<FONT face="Times New Roman">hWND</FONT>。</P> <P ><FONT face="Times New Roman">hDC</FONT>是一句柄,一个唯一<FONT face="Times New Roman">Windows</FONT>分配给表面设备的<FONT face="Times New Roman">ID</FONT>号,如屏幕或打印机,通过它你的应用程序可产生可视操作。</P> <P >你可通过<FONT face="Times New Roman">Windows API GetDC</FONT>函数可以得到自己的<FONT face="Times New Roman">hDC</FONT>,但使用完,一定要用<FONT face="Times New Roman">ReleaseDC</FONT>功能退出。一旦你有了<FONT face="Times New Roman">device context</FONT>,你可用适合你的应用程序的<FONT face="Times New Roman">Windows API</FONT>图表来使用它。例如,在一个应用程序里,这个应用程序能够在地图点位上提供图符设制,你就可以象如下程序:</P> <P >Private Sub mapMain_BeforeLayerDraw(ByVal index As Integer, ByVal hdc As Long)<p></p></P> <P >If index = 0 Then<p></p></P> <P >RenderIconicMarkers hdc, mapMain.Layers(index), picLogo<p></p></P> <P >End If<p></p></P> <P >Private Sub RenderIconicMarkers(hdc As Long, layer As MapLayer, pic As PictureBox)<p></p></P> <P >Dim recs As MapObjects.Recordset<p></p></P> <P >Set recs = layer.Records<p></p></P> <P ><p> </p></P> <P >Dim shpfield As MapObjects.Field<p></p></P> <P >Set shpfield = recs.Fields("Shape")<p></p></P> <P ><p> </p></P> <P >Do While Not recs.EOF<p></p></P> <P >Dim pt As MapObjects.Point<p></p></P> <P >Set pt = shpfield.Value<p></p></P> <P >DrawIconicMarker pt, pic, hdc<p></p></P> <P >recs.MoveNext<p></p></P> <P ><st1:place w:st="on">Loop</st1:place><p></p></P> <P >End Sub<p></p></P> <P ><p> </p></P> <P >Private Sub DrawIconicMarker(pt As MapObjects.Point, pic As PictureBox, hdc As Long)<p></p></P> <P >Dim x As Single, y As Single<p></p></P> <P >mapMain.FromMapPoint pt, x, y<p></p></P> <P >Dim xPixels As Integer, yPixels As Integer<p></p></P> <P >xPixels = Me.ScaleX(x, vbTwips, vbPixels)<p></p></P> <P >xPixels = Me.ScaleX(y, vbTwips, vbPixels)<p></p></P> <P >BitBlt hdc, xPixels - 16, yPixels - 16, 32, 32, pic, hdc, 0, 0, SRCCOPY<p></p></P> <P >End Sub<p></p></P> <P >另一方面,<FONT face="Times New Roman">hWnd</FONT>是<FONT face="Times New Roman">Map</FONT>的真正的句柄。它存在于较大的<FONT face="Times New Roman">hDC</FONT>中,尽管它设计成为地图的属性,实际上<FONT face="Times New Roman">hwnd</FONT>是<FONT face="Times New Roman">windows</FONT>变量,不能够改变,只有运用<FONT face="Times New Roman">API</FONT>子程序,才能通过它。</P> <P >在下面的例子中,当用户在地图上拖动鼠标,就会出现一个矩形,依据矩形的大小显示地图。程序得到了地图的<FONT face="Times New Roman">hwnd</FONT>属性,用来设置显示设备。</P> <P >Private Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long<p></p></P> <P >Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long<p></p></P> <P >Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long<p></p></P> <P >Private Declare Function SetROP2 Lib "gdi32" (ByVal hdc As Long, ByVal nDrawMode As Long) As Long<p></p></P> <P >Private Const R2_NOTXORPEN = 10<p></p></P> <P >Private Const R2_NOT = 6<p></p></P> <P >Dim g_hdc As Long<p></p></P> <P >Dim g_hwnd As Long<p></p></P> <P >Dim dragging As Boolean<p></p></P> <P >Dim xs As Integer, ys As Integer<p></p></P> <P >End Sub<p></p></P> <P ><p> </p></P> <P >Private Sub Form_Load()<p></p></P> <P >dragging = False<p></p></P> <P >End Sub<p></p></P> <P ><p> </p></P> <P >Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)<p></p></P> <P >dragging = True<p></p></P> <P >g_hwnd = Map1.hWnd<p></p></P> <P >g_hdc = GetDC(g_hwnd)<p></p></P> <P >SetROP<st1:chmetcnv w:st="on" UnitName="g" SourceValue="2" HasSpace="True" Negative="False" NumberType="1" TCSC="0">2 g</st1:chmetcnv>_hdc, R2_NOTXORPEN<p></p></P> <P >xs = Form1.Scale(X, vbTwips, vbPixels)<p></p></P> <P >ys = Form1.Scale(Y, vbTwips, vbPixels)<p></p></P> <P >Rectangle g_hdc, xs - 10, ys - 10, xs + 10, ys + 10<p></p></P> <P >End Sub<p></p></P> <P ><p> </p></P> <P >Private Sub Map1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)<p></p></P> <P >If dragging Then<p></p></P> <P >Rectangle g_hdc, xs - 10, ys - 10, xs + 10, ys + 10<p></p></P> <P >xs = Form1.Scale(X, vbTwips, vbPixels)<p></p></P> <P >ys = Form1.Scale(Y, vbTwips, vbPixels)<p></p></P> <P >Rectangle g_hdc, xs - 10, ys - 10, xs + 10, ys + 10<p></p></P> <P >End If<p></p></P> <P >End Sub<p></p></P> <P ><p> </p></P> <P >Private Sub Map1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)<p></p></P> <P >Rectangle g_hdc, xs - 10, ys - 10, xs + 10, ys + 10<p></p></P> <P >ReleaseDC g_hwnd, g_hdc<p></p></P> <P >dragging = False<p></p></P> <P >d = Form1.Scale(10, vbTwips, vbPixels)<p></p></P> <P >Dim pt As New MapObjects.Point<p></p></P> <P >Set pt = map1.ToMapPoint(X, Y)<p></p></P> <P >dist = map1.ToMapDistance(d)<p></p></P> <P >Set rect = CreateObject("MapObjects.Rectangle")<p></p></P> <P >rect.Left = pt.X - dist<p></p></P> <P >rect.Top = pt.Y + dist<p></p></P> <P >rect.Right = pt.X + dist<p></p></P> <P >rect.Bottom = pt.Y - dist<p></p></P> <P >map1.Extent = rect<p></p></P> <P >End Sub<p></p></P> <P >向层里加数据</P> <P >在往地图控件中的层集里加入图层和影像层之前,你需把层集与数据相连接。通过<FONT face="Times New Roman">DataConnection</FONT>和<FONT face="Times New Roman">GeoDataset</FONT>目标可从文件系统或<FONT face="Times New Roman">SDE</FONT>数据服务器中查找和连接数据。</P> <P ><FONT face="Times New Roman">DataConrection</FONT>目标</P> <P ><FONT face="Times New Roman">DataConrection</FONT>目标用来连接装有形文件的文件夹或<FONT face="Times New Roman">SDE</FONT>数据库。</P> <P >要连接形文件文件夹,需设置数据库特性为具有文件夹名的串,并应用<FONT face="Times New Roman">Connect</FONT>方法。连接<FONT face="Times New Roman">SDE</FONT>数据库,需设置数据库,密码,服务器和用户特性,并应用<FONT face="Times New Roman">Connect</FONT>方法和检查连接特性。</P> <P >如果连接错误,检查<FONT face="Times New Roman">ConnectError</FONT>特性,对比<FONT face="Times New Roman">ConnectionErrorCode</FONT>,寻找错误原因。</P> <P >当你进行连接时,<FONT face="Times New Roman">GeoDatasets</FONT>就会移到当前层或<FONT face="Times New Roman">SDE</FONT>层中的形文件集里。<FONT face="Times New Roman">GeoDatasets</FONT>并不是自动移到层集里,而是目的在于组织一个接口,用户可以选择形文件或<FONT face="Times New Roman">SDE</FONT>使用<FONT face="Times New Roman">GeoDatasets</FONT>集中的<FONT face="Times New Roman">FindGeoDataset</FONT>方法,来使形文件或<FONT face="Times New Roman">SDE</FONT>层连到<FONT face="Times New Roman">GeoDatasets</FONT>。</P> <P >你可使用<FONT face="Times New Roman">AllGeoDataset</FONT>方法生成一个新的形文件。当你用这样方法生成一个形文件,也就是生成了一个<FONT face="Times New Roman">TableDesc</FONT>来设置新的形文件的生成。请参照<FONT face="Times New Roman">MapObject</FONT>手册或<FONT face="Times New Roman">MapObjects</FONT>帮助功能中的程序例子。</P> <P ><FONT face="Times New Roman">GeoDataset</FONT>目标和<FONT face="Times New Roman">GeoDatasets</FONT>集</P> <P ><FONT face="Times New Roman">GeoDataset</FONT>表示从形文件或<FONT face="Times New Roman">SDE</FONT>层中得到的地图数据的一层。<FONT face="Times New Roman">Geo Datasets</FONT>集表示<FONT face="Times New Roman">DataConnection</FONT>里所有的<FONT face="Times New Roman">GeoDatasets</FONT>,即文件夹里所有的形文件或<FONT face="Times New Roman">SDE</FONT>数据库里所有的<FONT face="Times New Roman">SDE</FONT>层。</P> <P >注意,<FONT face="Times New Roman">MapObjects</FONT>中<FONT face="Times New Roman">GeoDataset</FONT>属性是只写的。一旦你将<FONT face="Times New Roman">GeoDataset</FONT>放置到<FONT face="Times New Roman">MapLayer</FONT>或其它目标上作为一种属性,那么它不能恢复或改写。</P> <P ><FONT face="Times New Roman">MapObjects</FONT>里有<FONT face="Times New Roman">3</FONT>种属性:<FONT face="Times New Roman">MapLayer</FONT>目标的<FONT face="Times New Roman">GeoDatasetct</FONT>属性;<FONT face="Times New Roman">AddressMatcher</FONT>目标的<FONT face="Times New Roman">SrreetTable</FONT>属性;<FONT face="Times New Roman">PlaceLocator</FONT>目标的<FONT face="Times New Roman">PlaceNameTable</FONT>属性。</P> |
|
1楼#
发布于:2007-09-11 16:30
hao wen
|
|
2楼#
发布于:2007-09-18 17:56
<P> 好</P>
<P>多发这样的贴</P> <P>顶!</P> |
|
3楼#
发布于:2007-09-21 17:01
<img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em02.gif" />
|
|
4楼#
发布于:2007-09-22 14:14
<img src="images/post/smile/dvbbs/em02.gif" />
|
|