IMapServerObjects接口过时了[deprecated],暂时可用,但是后期不会更新了

旧的描述:http://blog.sina.com.cn/s/blog_6a4e39250100m35z.html https://yq.aliyun.com/articles/357711[Server操作Mxd文件详细讲解(转载)]

新的

MapServer is a coarse-grained ArcObject.  This object allows users to display and query ArcGIS map documents in internet development environments. In a server environment, MapServer objects can be accessed via SOAP/XML over an HTTP connection (Internet) or via COM in a Server Object Extension (SOE). In SOE, you can use IRESTRequestHandler to process REST/JSON request. The MapServer coclass contains several interfaces like IMapServer, IMapServerDataAccess with functions for displaying and querying a map service.

MapServer是一个粗粒度的ArcObject,它允许用户在internet开发环境中显示和查询ArcGIS地图文档。在服务器环境中,可以通过HTTP连接(Internet)上的SOAP/XML或服务器对象扩展(SOE)中的COM访问MapServer对象。在SOE中,可以使用IRESTRequestHandler来处理REST/JSON请求。MapServer coclass包含几个接口,如IMapServer、IMapServerDataAccess,这些接口具有显示和查询地图服务的功能。

In addition to MapServer, a number of MapServer objects are defined to represent input and output parameters for methods on MapServer interfaces. For example, the IMapServer method ExportMapImage requires two inputs: a description of the map to be exported and a description of the output parameters.  These inputs are captured in the MapDescription and ImageDescription objects.

除了MapServer之外,还定义了许多MapServer对象来表示MapServer接口上方法的输入和输出参数。例如,IMapServer方法ExportMapImage需要两个输入:要导出的映射的描述和输出参数的描述。这些输入在mapsdescription和ImageDescription对象中捕获。

Though the methods and properties available through MapServer and its associated objects offer important mapping functionality, they cannot possibly encapsulate all that ArcObjects offers. In some cases you may want to use other, finer-grained, ArcObjects in conjunction with MapServer. Starting at 10.1, you can only do this in an SOE using the  IMapServerDataAccess interface which will give you access to the datasource (IFeatureClass or ITable ) of a layer or stand-alone table.

尽管MapServer及其关联对象提供的方法和属性提供了重要的映射功能,但它们不可能封装ArcObjects提供的所有功能。在某些情况下,您可能希望将其他更细粒度的ArcObjects与MapServer结合使用。从10.1开始,您只能使用IMapServerDataAccess接口在SOE中执行y以上的操作,该接口将允许您访问层或独立表的数据源(IFeatureClass或ITable)。

Please note that accessing fine-grained ArcObjects through IMapServerObjects interface has been deprecated at 10.1. Typically you would want to use IMapServerObjects interface to make changes to map, such as modifying a layer's renderer or adding a new layer. Starting at 10.1, you do not need to access fine-grained ArcObjects since these capabilities are available via the coarse-grained MapServer's API. If the mapservice you  are accessing is enabled with dynamicLayers (SupportsDynamicLayers), you can use IDynamicLayerDescription to change renderer or to set datasource for a new layer.

请注意通过IMapServerObjects接口获取AO已经过时了。通常你想要使用IMapServerObjects进行地图的更改,例如修改一个图层的渲染或者添加一个新的图层。从10.1开始,你不需要获取到AO,因为这些功能可以通过coarse-grained的MapServer的API获得。如果你获取的mapservice支持动态图层,你可以使用IDynamicLayerDescription来更改渲染,或者为一个新图层设置数据源。

It is important to know that all changes made to the MapServer object are temporary. A temporary change would include changes to the MapDescription or LayerDescription using IMapDescription, ILayerDescription or IDynamicLayerDescription. For example, you might change the geographic extent of a map (MapArea), change the visibility (Visible) or renderer (DrawingDescription) of a layer or even add a new layer on-the-fly. These changes are temporary and valid for the duration of the call (stateless). Once the call has ended the MapServer object returns to it's default state and does not remember the changes made by the previouscall.

重要的是要知道对MapServer对象所做的所有更改都是临时的。临时更改包括使用IMapDescription、ILayerDescription或IDynamicLayerDescription对MapDescription或LayerDescription进行更改。例如,可以更改地图的地理范围(MapArea),更改图层的可见性(Visible)或渲染器(DrawingDescription),甚至可以动态添加新图层。这些更改是临时的,在调用期间有效(无状态)。调用结束后,MapServer对象将返回其默认状态,并且不记得前一个调用所做的更改。

You may find GenerateDataClassesfunction to get unique values from fields or generate classes from a field and optionally ask for renderer that can be used with ExportMapImage.

Only certain symbols are supported when working with the MapServer WSDL. These include ISimpleMarkerSymbol, ICharacterMarker, IPictureMarker, ISimpleLineSymbol, ISimpleFillSymbol and IPictureFill.

A MapServer service can have an associated tiled map cache. ArcGIS map services can use a tile cache to significantly improve performance while delivering maps. A map service that fulfills requests with pre-created tiles from a cache instead of dynamically rendering part of the map is called a cached map service. The map cache is a repository that contains image tiles for map extents at specific scale levels.

Service publishers create the cache for a map service using geoprocessing tools in ArcCatalog or via scripting. Applications that work with a cached map service can directly access tiles from the tile cache. Such applications include ArcGIS for Desktop, the ArcGIS for Server Web ADF applications. While other applications that are based on ArcGIS for Server JavaScript, Silverlight or Flex API access tiles using the tile handler.

For optimal performance, use caches. Applications built with caches do not use the parent map service, but instead pull the images directly from the cached virtual directory or by using a tile handler web service running on the server. Use ICacheDescription to get information on the cached service.

Working with MapServer with a cached map service can be different than working with a map service without a cache. Though you will be able to query against a cached map service just as you would a non-cached map service, you will see differences when working with cached map service's MapDescription and the LayerDescription of any map layer belonging to a cache.

If the map service is a cached map service then custom graphics, the rendering of selected features etc. cannot be applied to the MapDescription. In addition, any changes made to the LayerDescription of any of the map layers, such as applying a definition expression, applying a selection buffer, toggling the visibility of labels or changing the visibility of the layer itself are ignored. You will need to use ITileCacheInfo to change the spatial reference or call ExportMapImage function with different spatial reference set to IMapDescription. In the latter case you will get one single image projected to the requested spatial reference instead of multiple tiles.

>>应用例子:通过IDynamicLayerDescription修改显示样式和数据源:当然这只是暂时的,一次请求一次生成

但是这很适合临时性的或者说是实时性的工作。。无论通过http:.../dynamiclayer?layer=.....renderer...还是通过后端.....所做的修改均只是临时的。

更多请查看:

https://blog.csdn.net/nmj2008/article/details/114978139

出图:

通过dynamic layer可以设置样式,设置。。可以设置很多。。

猜你喜欢

转载自blog.csdn.net/nmj2008/article/details/114971948