zoukankan      html  css  js  c++  java
  • MICAPS二次开发一些功能调用

    1、调用地图并将micaps文件加载地图上
    IFileBindingService fbs = ServiceLocator.Current.GetInstance< IFileBindingService>();
                ILayer layer = fbs.CreateLayerForFile(new CMA.MICAPS.Infrastructures.FileSystems.FSPath ("D:\测试文件夹\555"));
                IMapManager mapManager = ServiceLocator .Current.GetInstance<IMapManager>();
                Map map = mapManager.ActiveMap.Map;
                map.Layers.Add(layer);
    2、加载m4省界地图
      /// <summary>
            /// 加载省界地图
            /// </summary>
            public static void addTheShengMap()
            {
                CommandManager cm = Bootstrapper .Current.GetService<CommandManager>();
                Configuration config = new Configuration();
                config.SetString( "name", "山西省" );
                config.SetColor( "color", Color .YellowGreen);
                cm.GetCommandBinding( "set_mask_cmd").Command.Execute(config);
     

      //显示市县边界  

      LayerManager lm = ServiceLocator.Current.GetInstance<LayerManager>();
      IMultiLayer layer = (IMultiLayer)lm.CurrentMap.Layers[0];
      // var country= layer.SubLayers.Find(m => m.Name == "县界");
      var city = layer.SubLayers.Find(m => m.Name == "市界");
      lm.SetVisible(city, true);

     
            }
    3、把地图转成图片导出
            /// <summary>
            /// 把地图转成图片导出
            /// </summary>
            public static void outTheMapToPic()
            {
                  ImageCapturer.Capture().Save("D:\pic.png");//调用m4将地图导出为图片的方法
            }
  • 相关阅读:
    【转】免费搭建独立博客,WordPress+独立域名+独立空间
    MongoDB索引
    面向对象
    浏览器为webapp
    转载Chrome浏览器IOS
    浅淡Webservice、WSDL三种服务访问的方式(附案例)
    Plupload
    转载Yale CAS + .net Client 实现 SSO(6)
    java 对Hbase的基本操作
    【精】iOS开发视频教程下载
  • 原文地址:https://www.cnblogs.com/yanjinliang/p/5916416.html
Copyright © 2011-2022 走看看