动态更改地图图层符号系统 (ArcGIS Server)
动态更改图层符号系统的首选方法是什么?我的 Web 应用程序通过 REST API 使用地图服务,但我不介意使用 SOAP API 或 ArcObjects (.NET)。
What is the preferred method of altering a layer's symbology dynamically? My web app consumes a map service via the REST API, but I don't mind using the SOAP API or ArcObjects (.NET).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从版本 2.0 开始,ESRI JS API 中就存在功能层。
ESRI API 示例展示了如何使用渲染器通过要素图层通过指定的唯一值和属性来更改动态地图服务的默认符号系统。类中断渲染器。由于要素图层源自图形图层对象,因此它们的渲染方式不同(客户端与服务的即时 img/tile 导出)。尽管如此,它们确实允许根据开发人员定义的字段/值更改图层外观。
请注意在动态地图服务上使用唯一值渲染:
示例(代码) http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/renderer_unique_value.html
实时示例
http://developers.arcgis.com/en/javascript/samples/renderer_unique_value/
As of version 2.0, feature layers existed in the ESRI JS API.
ESRI API samples show the use of renderers being used to change the default symbology for dynamic map services via feature layers through assigned unique value & class breaks renderers. As feature layers are derived from the graphics layer object, they render differently (client side vs. services' on the fly img/tile export). Nevertheless, they do allow the alteration of a layers appearance based on developer defined fields/values.
Note the use of a unique value render on a dynamic map service in this:
example (code) http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/renderer_unique_value.html
live sample
http://developers.arcgis.com/en/javascript/samples/renderer_unique_value/
REST API 是无状态的,因此您无法通过连接到 RESTful 服务来更改符号系统(尽管您可以使用图形层来动态提取要以不同方式显示的功能)。
使用 SOAP API(通过 Web ADF 或简单地通过 SOAP 手动连接到服务)并更改其中的符号系统,您会获得更好的运气。有关此内容的更多信息,请访问:http:// forums.esri.com/Thread.asp?c=158&f=2421&t=266974
The REST API is stateless, so you can't change the symbology via a connection to a RESTful service (although you could use a graphics layer to dynamically extract the features you want to display differently).
You'll have better luck using the SOAP API (via the Web ADF or simply connecting to the service via SOAP manually) and altering the symbology there. More information about this is available here: http://forums.esri.com/Thread.asp?c=158&f=2421&t=266974
如果您想要更改地图服务中符号的外观,则需要使用 WebADF 或创建您自己的使用 SOAP API 的服务。更改符号然后生成图像的实际操作非常简单,困难的部分是获得开放层来使用它。我要么不打扰,要么按照迈克尔的建议,将图形带回客户端并使用 OpenLayers 根据需要绘制它们,也许将图层设置为在地图服务中不可见,以便它们不会显示在图形下方。
If you want to change the appearance of the symbol in the map service its self then you need to either use the WebADF or create your own service that uses the SOAP API. The actual bit to change the symbol and then produce an image is quite easy, the hard part will be to then get open layers to consume it. I would either not bother or do as Michael suggests and bring back graphics to the client and draw them as you wish using OpenLayers, maybe have the layer set to invisible in the map service, so that they don't show up under the graphics.