zoukankan      html  css  js  c++  java
  • MapXtreme2004常用代码

    1、加载地图,选择图层
    if(!Page.IsPostBack)
      {
       MapControl1.Map.Clear();
       MapControl1.Map.Load(MapLoader.CreateFromFile(Server.MapPath("/mymap")+"\\map\\xy.gst"));
       MapControl1.SelectableLayers.Clear();
       MapControl1.SelectableLayers.Add("o地名p");
      }
    可以把图层当成一个结果集
    (_tempTable as IFeatureCollection).Clear();
    2、遍历所有结果集
      Selection sl =MapInfo.Engine.Session.Current.Selections.DefaultSelection;
      IResultSetFeatureCollection fc=sl[0];
      IFeatureEnumerator fn=fc.GetFeatureEnumerator();
      ListBox1.Items.Clear();
      while(fn.MoveNext())
       if(fn.Current.Geometry.GetType().ToString()=="MapInfo.Geometry.LegacyText")
        ListBox1.Items.Add(((MapInfo.Geometry.LegacyText)fn.Current.Geometry).Caption);
    3、根据关键字获得(第一个)图元
       MapInfo.Engine.Session.Current.Catalog.SearchForFeature("Layer1",MapInfo.Data.SearchInfoFactory.SearchWhere("MI_Key='"+strKey+"'") )

  • 相关阅读:
    javascript 构造函数,工厂模式,稳妥构造函数浅析
    javascript基本概念
    struts2 类型转换
    struts action
    struts2 配置(部分)
    struts2基本构成
    charapter 1
    java 内部类
    mysql zip 解压安装 (win10)
    python之random模块
  • 原文地址:https://www.cnblogs.com/googlegis/p/2978965.html
Copyright © 2011-2022 走看看