arcgis收藏标注在Graphic toJson遇到的问题!
2017-03-02 09:30
155 查看
关于Arcgis使用方面在国内的相关文献资料还是比较少的,在此提交一些个人的经历希望有帮助。在收藏标注的时候需要把Graphic转成json数据收藏,看了一下方法:
Graphic tempGraphic = new Graphic(polygon, fillSymbol);
如果此Graphic没有添加"attributes"通过toJon转Json结果:
String s= Graphic.toJson(tempGraphic);
debug : "s:{}"
如果手动添加:
Map<String, Object> attributes=new HashMap<>();
attributes.put("dfe","efetgrg");
Graphic setGeo=new Graphic(polygon, fillSymbol,attributes);
通过Graphic.toJson(setGeo)得到的结果:
String s= Graphic.toJson(setGeo);
debug :s={"attributes":{"dfe":"efetgrg"}}
经此结果发现Graphic未能将一个图形数据转成Json.后发现一个方法:FeatureSet.toJson(featureSet);
Graphic setGeo=new Graphic(polygon, fillSymbol,attributes);
FeatureSet featureSet=new FeatureSet();
Graphic [] graphics=new Graphic[1]; graphics[0]=setGeo;
featureSet.setGraphics(graphics);
String str=FeatureSet.toJson(featureSet);debug :
str={"exceededTransferLimit":false,"geometryType":"esriGeometryPolygon","features":[{"attributes":{"dfe":"efetgrg"},"geometry":{"rings":[[[24669.591694145365,76009.02461170929],[26538.518712987898,61677.42716260094],[24669.591694145365,76009.02461170929]]]}}]}
红色的数据为图形数据。
由此证明FeatureSet.toJson(featureSet)才能将图形数据转出来;
相关文章推荐
- 遇到的问题总结 分类: 问题总结 2013-10-28 17:21 263人阅读 评论(0) 收藏
- ArcGIS 10开发WPF程序时遇到的问题
- ArcGIS for Android 10.1.1API 中文标注导致程序异常崩溃问题
- 小功能,大问题,ArcGis GeometryServer判断点是否在面中所遇到的问题
- 新建cocos2dx开发遇到问题及解决办法 分类: cocos2d安装设置 2015-07-08 21:47 7人阅读 评论(0) 收藏
- 收藏:JavaMail使用SSL遇到安全证书问题
- Windows XP 下安装ArcGIS 9.0时遇到的问题与解决方法
- 在windows web server 2008 R2中安装Arcgis时可能会遇到的问题
- Spark做词性标注遇到的问题及解决方法
- ArcGis:vs c#编程遇到问题The specified filename is invalid
- 《ArcGIS Runtime SDK for Android开发笔记》——问题集:如何解决ArcGIS Runtime SDK for Android中文标注无法显示的问题(转载)
- 在ArcGIS Catalog中删除rastercatalog图层后遇到的问题
- Hadoop 2.4.1 搭建Ha遇到问题记录 分类: hadoop 2015-07-08 22:35 133人阅读 评论(0) 收藏
- VC++中可能遇到的问题收藏
- 《ArcGIS Runtime SDK for Android开发笔记》——问题集:如何解决ArcGIS Runtime SDK for Android中文标注无法显示的问题(转载)
- arcgis api for javascrpit 与easyui相结合时遇到的一个问题
- ArcGIS10.0操作之10—矢量化遇到的问题(The feature can not be created. The geometry is valid)
- VS2010无法调试问题解决 最近,因为公司开发的需要,对开发环境进行全面的升级,在这其中也遇到了不少问题,在之后将陆续整理出来,以便以后查看。 之前开发环境:VS2008,ArcGIS9.3,Ar
- ArcGIS API for flex遇到的问题解决(1)--地图服务url传值问题
- libvirt安装过程中遇到的问题 分类: ubuntu学习 2014-04-28 16:07 3526人阅读 评论(0) 收藏