Presentation is loading. Please wait.

Presentation is loading. Please wait.

Page 1 Layers  用户的数据反映在地图上 通常根据点、线、面的层 次结构进行归类。每一个 独立的图层都可以作为一 个独立的地图。 MapX 中 调用的是一个由多个独立 地图图层组成的地图集合 。

Similar presentations


Presentation on theme: "Page 1 Layers  用户的数据反映在地图上 通常根据点、线、面的层 次结构进行归类。每一个 独立的图层都可以作为一 个独立的地图。 MapX 中 调用的是一个由多个独立 地图图层组成的地图集合 。"— Presentation transcript:

1 Page 1 Layers  用户的数据反映在地图上 通常根据点、线、面的层 次结构进行归类。每一个 独立的图层都可以作为一 个独立的地图。 MapX 中 调用的是一个由多个独立 地图图层组成的地图集合 。

2 Page 2 Regions Lines Points Text Pacific Ocean

3 Page 3 Layers Methods  图层控制对话框 Map1.Layers.LayersDlg

4 Page 4 Layers Property  AnimationLayer ( 示例 )  Bounds  Count  InsertionLayer This property specifies what new layer objects will be inserted into by the built-in object editing tools.  Item

5 Page 5 Layers Methods  建新层 Map1.Layers.CreateLayer “Offices” [Layer=]OBJECT.CreateLayer (Name, [FileSpec], [Position], [KeyLength], [CoordSys])  加入图层 Map1.Layers.Add “C:\Data\Ireland.tab” [Layer=]OBJECT.Add (LayerInfo, [Position]) ] LayerInfo: This can be either a LayerInfo object or a Pathname of the MapInfo table (.TAB) file to be added as a layer. If no Position parameter is specified, the layer is positioned automatically with respect to other layers in the map. For example, a layer with points is placed above a layer with regions.

6 Page 6 Layers Methods  删除图层 Map1.Layers.Remove 3  移动图层 Map1.Layers.Move 1,2  用户自定义图层 Map1.AddUserDrawLayer ( 示例 )

7 Page 7 layerInfo 对象  标准 Table 表:  用户自定义图层:在此图层中,用户可以使用如 Windows API 函 数来画图。  可自注册的栅格图象:如: GeoTiff 。  栅格图象:以 Tab 表形式调入。支持 24 位真彩栅格图象。支持格 网文件支持 (MIG) 。  ARCVIEW 的 SHAPE 文件:步骤如下: – .将其中的 DBF 文件写成 TAB 表形式. – .打开.tab 文件,将 “Type DBF Charset "WindowsSimpChinese"” 改为 ”Type SHAPEFILE Charset "WindowsSimpChinese"”. – .将文件加入应用.

8 Page 8 LayerInfoTypeConstants  miLayerInfoTypeTab = 0  miLayerInfoTypeUserDraw = 1  miLayerInfoTypeRaster = 2  miLayerInfoTypeShape = 3  miLayerInfoTypeServer = 4  miLayerInfoTypeGeodictUserName = 5  miLayerInfoTypeTemp = 6  miLayerInfoTypeNewTable = 7

9 Page 9  远程数据库  连 接 ODBC 数据源, MS Access/SQL Server/ 其他 ODBC 数据 源. :要求数据库已经地图化。程序: Dim LayerInfo As New MapXLib.LayerInfo LayerInfo.Type = miLayerInfoTypeServer LayerInfo.AddParameter “name”, “ODBCLayer” ’ ‘Mapstats 为 ODBC 数据源 LayerInfo.AddParameter”connectstring",“Mapstats” LayerInfo.AddParameter "query",”Select * from Us_cust” LayerInfo.AddParameter "cache", “on” LayerInfo.AddParameter "MBRSearch", “on” LayerInfo.AddParameter "toolkit", "ODBC" layerinfo.AddParameter "AutoCreateDataset", 1 layerinfo.AddParameter "datasetname", “us_cust” Set lyr = Formmain.Map1.Layers.Add(LayerInfo, 1)

10 Page 10   连接 Oracle8I 数据源 , 通过 Oracle Call Interface (OCI) MapX 可以将存储在 Oralce8I 数据库服务器中的 Mapinfo 空间数 据和属性数据同时下载到本地 。  Dim LayerInfo As New MapXLib.LayerInfo  LayerInfo.Type = miLayerInfoTypeServer LayerInfo.AddParameter “name”, “oranLayer” LayerInfo.AddParameter”connectstring",“uid=system;pwd=manager;srvr=mapx” LayerInfo.AddParameter “query”,”Select * from Us_cust” LayerInfo.AddParameter “cache”, “on”  LayerInfo.AddParameter “MBRSearch”, “on”  LayerInfo.AddParameter "toolkit", "ORAINET” layerinfo.AddParameter "AutoCreateDataset", 1  layerinfo.AddParameter "datasetname", “us_cust” Set lyr = Formmain.Map1.Layers.Add(LayerInfo, 1)

11 Page 11  连接空间数据服务器如 SpatialWare for Oracle, SpatialWare Informix DataBlade, 以及 SpatialWare DB2 Extender. 采用 ODBC 连接. 连接空间数据服务器亦可使用 AddServerLayer 方法: Map1.Layers.AddServerLayer "ssa","DSN=Spatial;HOST=spw;UUID=mapzk;UPWD=mapzk;UID=mapzk; PWD=mapzk;OSID=map", "select * from ""sloil"""

12 Page 12 常用的 Layer property  AutoLabel  Name  OverrideStyle  Selectable, Editable, Visible  Style  ZoomLayer, ZoomMax, ZoomMin  FileSpec  Type  LabelProperties

13 Page 13 常用的 Layer method AddFeature, DeleteFeature BeginAccess, EndAccess This method will open and lock the table for read/write access. This improves the performance for repeated layer and Dataset operations. You must call Layer.EndAccess once for each call to Layer.BeginAccess. Refresh UpdateFeature Search [ Features collection= ]OBJECT.Search (strWhere, [Variables]) strWhere : An expression to evaluate for each feature.

14 Page 14 标准 Tool 的使用 很多地图应用,都需要用户给出一些地图控件。大多数 解决方法是提供给用户一些工具类型。 Map1.CurrentTool = miRadiusSelectTool Map1 是 MapX 的对象名, miRadiusSelect 是常量。在指定位置 使用用户工具。

15 Page 15 标准 Tool 的分类  Navigation tools (Zoom-In, Zoom-Out, Pan, Center) that let the user change the scale and placement of the map.  A Labeling tool that lets the user click a map feature to label it.  A set of Selection tools that give the user various ways to select map features.  Annotations (symbols and text).

16 Page 16 标准 Tool 的使用

17 Page 17 自定义 Tools  用户可以创建自定义工具,按照以下三步. 创建工具. 编写工具程序代码. 使用工具

18 Page 18 Step 1: 创建用户自定义工具 下面是帮助文件中解释用户自定义工具的说明, [ ] 里面是可 选参数:  Map.CreateCustomTool ToolNumber, Type, Cursor, [ShiftCursor], [CtrlCursor] ToolNumber 以后要引用工具的编号,在 1-99 之间 Type 描述工具类型 Cursor 当前使用工具的光标形状。 ShiftCursor 当前使用工具的光标形状 ,按住 键光标 被隐藏。 CtrlCursor 当前使用工具的光标形状,按住 键光标被隐 藏。

19 Page 19 常数

20 Page 20 自定义 Tools  Step2. 指定程序将执行的任务: 使用过程工具 例如,你要画一条长线,这时用户需要 在地图上使用工具记录移动的状况。由此,在地图对 象上使用 MouseMove 事件。 使用工具 例如,用鼠标画出一个圆,以便计算圆内的 用户数。由此,需要使用功能性工具,在地图对象上 使用 ToolUsed 事件。

21 Page 21 自定义 Tools  Step3. 如果要使用工具,需要设置 MapX 对 象 CurrentTool 的值。 Map1.CurrentTool = miCenterTool Map1.CurentTool = 430

22 Page 22 style  Map.defaultstyle  layer.style  feature.style The Style Override is only in effect during the current work session, as are the other display settings. To make them permanent,you would have to modify the geoset.

23 Page 23 Style: Feature 的属性设置  Style.LineColor  Style.LineWidth  Style.LineWidthUnit  Style.RegionBackColor  Style.RegionBorderColor  Style.RegionBorderStyle  Style.RegionBorderWidth  Style.SupportsBitmapSymbols  Style.SymbolBitmapColor  Style.SymbolCharacter  Style.SymbolFont  Style.TextFont  Style.TextFontColor  Style.SymbolType  Style.Clone  Style.DrawLineSample  Style.DrawRegionSample  Style.DrawSymbolSample  Style.DrawTextSample  Style.ExportLineSample  Style.ExportRegionSample  Style.ExportSymbolSample  Style.ExportTextSample  Style.PickLine  Style.PickRegion  Style.PickSymbol  Style.PickText 常用 property 常用 method

24 Page 24 Style: Feature 的属性设置  Style.PickLine  Style.PickRegion  Style.PickSymbol  Style.PickText

25 Page 25 coordinate Every map has a coordinate system, which affects mapping software in various ways:  The coordinate system affects how X-Y coordinates are processed. For example, a location can be expressed in terms of degrees longitude/latitude, or it can be expressed in terms of other units, such as meters.  The coordinate system affects the appearance of the map. Changing a map's coordinate system can make the map appear stretched or distorted.

26 Page 26 coordinate Every map has a coordinate system, which affects mapping software in various ways:  The coordinate system affects how X-Y coordinates are processed. For example, a location can be expressed in terms of degrees longitude/latitude, or it can be expressed in terms of other units, such as meters.  The coordinate system affects the appearance of the map. Changing a map's coordinate system can make the map appear stretched or distorted.

27 Page 27 coordinate  Map.DisplayCoordSys 显示坐标系统  Map.NumericCoordSys 数字坐标系统  Layer.CoordSys If you set the Map.DisplayCoordSys to match a Layer.CoordSys, you maximize the display speed of that layer. Note: If a map includes one or more raster image layers, MapX automatically displays the map in the projection specified by the most visible raster image. The coordinate system could then change as the map view changes (due to zooming or panning) if a different raster image with a different projection becomes the most visible. In this case, you cannot change the map's display coordinate system.


Download ppt "Page 1 Layers  用户的数据反映在地图上 通常根据点、线、面的层 次结构进行归类。每一个 独立的图层都可以作为一 个独立的地图。 MapX 中 调用的是一个由多个独立 地图图层组成的地图集合 。"

Similar presentations


Ads by Google