前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >加点的心得

加点的心得

作者头像
用户1075292
发布2018-01-23 10:08:29
7620
发布2018-01-23 10:08:29
举报
文章被收录于专栏:听雨堂听雨堂

加点的一般方法:

代码语言:js
复制
   Catalog _catalog=MapInfo.Engine.Session.Current.Catalog;  
   MapInfo.Geometry.Point pt = new MapInfo.Geometry.Point(map.GetDisplayCoordSys(),dp);
   MapInfo.Styles.SimpleVectorPointStyle vs = new MapInfo.Styles.SimpleVectorPointStyle();
   vs.PointSize = 8;
   vs.Color = Color.DarkMagenta;
 
   Feature ft2=new Feature(tb.TableInfo.Columns);
   string strID=DateTime.Now.ToString("hhmmss");
   ft2.Geometry=pt;
   ft2["f_name"]=PointName;
   ft2["ID"]=strID;
   ft2["MI_Style"]=vs;
   tb.InsertFeature(ft2);

   Feature ft3=MapInfo.Engine.Session.Current.Catalog.SearchForFeature(tb.Alias,MapInfo.Data.SearchInfoFactory.SearchWhere("ID="+strID+" and f_name='"+PointName+"'"));
   return ft3.Key.Value;

但是每次添加的都是五角星,如果想添加其他形状该怎么办?MapInfo中有一个默认的符号库(自己看英文帮助,查词霸,猜得意思)VectorPointStyleRepository,其中有36个元素,每个元素的值是一个SimpleVectorPointStyle类型。

Property Value

The element SimpleVectorPointStyle at the specified index.

这样,就不用生成新的样式,直接调用它就行了,把vs的赋值直接换成这个:

代码语言:js
复制
MapInfo.Styles.SimpleVectorPointStyle vs = (MapInfo.Styles.SimpleVectorPointStyle)MapInfo.Engine.Session.Current.StyleRepository.VectorPointStyleRepository[2];
//索引的范围0-35

我做了一个试验,把所有的符号都取了出来,如图:

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2005-08-01 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Property Value
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档