private byte[] getLayerCountByType(System.Collections.Specialized.NameValueCollection boundVariables, ESRI.ArcGIS.SOESupport.JsonObject operationInput, string outputFormat, string requestProperties, out string responseProperties) { IMapImage mapImage = null; bool? shouldAdd = null; operationInput.TryGetAsBoolean("addlayer", out shouldAdd); if (shouldAdd.HasValue) { if ((bool)shouldAdd) { if (((IMapServerInfo4)mapServerInfo).SupportsDynamicLayers) { IRgbColor color = new RgbColor(){ Blue = 255}; ISimpleLineSymbol outline = new SimpleLineSymbol(){ Color = color, Width = 1, Style = esriSimpleLineStyle.esriSLSSolid }; ISimpleFillSymbol sfs = new SimpleFillSymbol(){ Color = color, Outline = outline, Style = esriSimpleFillStyle.esriSFSSolid }; ISimpleRenderer sr = new SimpleRenderer(){ Symbol = (ISymbol)sfs }; IFeatureLayerDrawingDescription featureLayerDrawingDesc = new FeatureLayerDrawingDescription(){ FeatureRenderer = (IFeatureRenderer)sr }; IMapServerSourceDescription mapServerSourceDesc = new TableDataSourceDescriptionClass(); ((IDataSourceDescription)mapServerSourceDesc).WorkspaceID = "MyFGDB"; ((ITableDataSourceDescription)mapServerSourceDesc).TableName = "B"; IDynamicLayerDescription dynamicLayerDesc = new LayerDescriptionClass(){ ID = 3, Visible = true, DrawingDescription = (ILayerDrawingDescription)featureLayerDrawingDesc, Source = mapServerSourceDesc }; mapDesc.HonorLayerReordering = true; mapDesc.LayerDescriptions.Insert(0, (ILayerDescription)dynamicLayerDesc); mapImage = exportMap(); } } else { mapImage = exportMap(); } } responseProperties = null; JSONObject json = new JSONObject(); json.AddString("URL", mapImage.URL); return Encoding.UTF8.GetBytes(json.ToJSONString(null)); }
private IMapImage exportMap() { //export the map using the current map description IImageType imageType = new ImageType() { Format = esriImageFormat.esriImagePNG32, ReturnType = esriImageReturnType.esriImageReturnURL }; ImageDisplay id = new ImageDisplay() { Height = 400, Width = 400, DeviceResolution = 150 }; //sample has this from ImageDisplay also IImageDescription idesc = new ImageDescriptionClass(); idesc.Display = id; idesc.Type = imageType; return ((IMapServer4)ms).ExportMapImage((IMapDescription)mapDesc, idesc); }
How to draw a dynamic layer to a map server如何在map server中添加一个动态图层呢?
This is a C# sample shows how to draw a dynamic layer in a .NET SOE. It shows how to create and use the JSONObject CoClass and IJSONObject interface.
这是一个C#例子,向你展示如何在一个.NET SOE中绘制一个动态图层。它展示了如何创建并且使用JSONObject CoClass和IJSONObject接口。
[Documentation on LayerDescription CoClass] (http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000rzt000000)
关于LayerDescription CoCloass请参照
Features
- Uses IDynamicLayerDescription使用IDynamicLayerDescription
- Uses JSONObject CoClass使用JSONObject CoClass
- Uses IMapServerDataAccess使用IMapServerDataAccess
- Uses IMapServerInfo使用IMapServerInfo
file:///C:/Users/RATE_YU/Documents/Visual%20Studio%202010/Projects/ServerSimpleRESTSOE/ReadMe.htm
不要过程,只要结果
参考:https://www.cnblogs.com/giser-whu/p/3707061.html (ArcEngine下动态数据的实现显示——GIS经常需要以高频率显示信息并能够清晰的传递地理信息。包括:以动画的方式移动物体,更新位置方位,大小,状态以及属性信息等,这些信息需要迅速更新。)
要用IE浏览器部署。。否则会出现token验证问题,不知道为什么。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2020-12-27 WGS84转gcj02
2020-12-27 ArcGIS Server跨域
2019-12-27 yolov3 train.py
2018-12-27 CVPR,ICCV和ECCV,计算机视觉三大顶级盛会