zoukankan      html  css  js  c++  java
  • (转)基于MapWinGis开发探索(二)——注册、加载、基本操作

     此次主要是控件的注册,以及用C#开发的图层加载和一些基本操作。

      一、注册MapWinGis.ocx主键

      (1)如果直接安装MapWinGis的安装文件,则无需在注册。

      (2)如果没直接安装,则要注册MapWinGis.ocx主键。可自行下载(官网http://www.MapWindow.org/.)。

      http://svn.mapwindow.org/svnroot/MapWindow4Dev/Bin/.

      注册命令行:cmd--》regsvr32 "C:\Program Files\MapWindow\MapWinGIS.ocx" 后面为存放的绝对路径。如果有新版本的MapWinGis.ocx。需要反注册regsvr32-u "C:\Program Files\MapWindow\MapWinGIS.ocx",然后在注册新版的MapwinGis.ocx。

      二、在VS2005内,c#开发。工具箱的选择项添加MapWinGIS ActiveX。工具箱就会出现MapControl控件,即可添加axMap地图控件。跟平常添加新控件操作一样,主要是为了得到地图控件。

      三、往地图控件加载图层。

    MapWinGIS.Shapefile fileName = new MapWinGIS.Shapefile();
      //读取ShapeFile文件
     fileName.Open(Environment.CurrentDirectory + @"\bou1_4p.shp", call);
    //加载图层
    axMap1.AddLayer(fileName, true);

      四、基本的地图操作

      放大:axMap1.CursorMode = MapWinGIS.tkCursorMode.cmZoomIn;

      缩小:axMap1.CursorMode = MapWinGIS.tkCursorMode.cmZoomOut;

      漫游:axMap1.CursorMode = MapWinGIS.tkCursorMode.cmPan;

      全幅:axMap1.ZoomToMaxExtents();

      全幅图:

    基于MapWinGis开发探索(二)——注册、加载、基本操作

      放大图:

    基于MapWinGis开发探索(二)——注册、加载、基本操作

      缩小图:

    基于MapWinGis开发探索(二)——注册、加载、基本操作

      漫游图:

    基于MapWinGis开发探索(二)——注册、加载、基本操作

  • 相关阅读:
    三种负载均衡 Nginx、Dubbo、Ribbon 区别
    Docker基础学习
    主从复制报错2061:Authentication plugin 'caching_sha2_password' reported error:Authentication require secure connection
    LRU、LFU算法区别
    CAP理论原理
    Mysql安装服务到Window服务列表
    从零开始掌握 HAProxy 负载均衡器,详细!!
    一举拿下Nginx
    Nginx 负载均衡配置误区
    Linux自动化技巧
  • 原文地址:https://www.cnblogs.com/tuncaysanli/p/1584942.html
Copyright © 2011-2022 走看看