Get Layer Drawing Description
[Visual Basic .NET] Public Function GetDefaultLayerDrawingDescriptions ( _ ByVal MapName As String, _ ByVal pLayerIDs As ILongArray, _ ByVal outputOptions As IServerSymbolOutputOptions _ ) As ILayerDrawingDescriptions
[C#] public ILayerDrawingDescriptions GetDefaultLayerDrawingDescriptions ( string MapName, ILongArray pLayerIDs, IServerSymbolOutputOptions outputOptions );
[C++]
HRESULT GetDefaultLayerDrawingDescriptions(
BSTR MapName,
ILongArray* pLayerIDs,
IServerSymbolOutputOptions* outputOptions,
ILayerDrawingDescriptions** ppLayerDrawingDescriptions
);
[C++]Parameters
MapName [in] MapName is a parameter of type BSTR pLayerIDs [in]pLayerIDs is a parameter of type ILongArray
outputOptions [in]outputOptions is a parameter of type IServerSymbolOutputOptions
ppLayerDrawingDescriptions [out, retval]ppLayerDrawingDescriptions is a parameter of type ILayerDrawingDescriptions
Product Availability
Remarks
An array of ILayerDrawingDescription for layers which IDs were passed in. The result contains drawing descriptions only for feature layers. Therefore the count of input LayerIDs may not match with the count of returned array. If any ID is passed in that is neither of a FeatureLayer nor of an existing layer, no drawing description will be returned for that ID.
You may want to use IMapLayerInfo::HasLayerDrawingDescription to check whether MapServer will return ILayerDrawingDescription for a layer.
outputOptions parameter can be Null, in that case MapServer returns images in PNG format. In absence of virtual directory images are returned as PNG mime.
A LayerDrawingDescription object contains information on the symbology and label specified by the author. FeatureRenderer describes how the layer is symbolized while LabelingDescription contains all label classes defined in the source map by the author.
Please note that MapServer only returns the followings:
Types of renderer:
- SimpleRenderer
- UniqueValueRenderer
- ClassBreaksRenderer (Data exclusion from renderer is not currently supported)
Types of symbol:
point features
- SimpleMarkerSymbol
- PictureMarkerSymbol
line features
- SimpleLineSymbol
polygon features
- SimpleFillSymbol
- PictureFillSymbol
If a layer’s renderer is not one of those supported one, nothing will be returned. Symbols that are not the supported get downgraded to one of supported one. Please see the rules below.
Here is how a layer’s symbols get downgraded:
Point symbols
- Simple marker symbols is returned as ISimpleMarkerSymbol
- Any other types such as IPictureMarkerSymbol, ICharacterMarkerSymbol, IMultiLayerMarkerSymbol etc. are returned as IPictureMarkerSymbol.
Line symbols
- ISimpleLineSymbol is returned as it is without any down gradation.
- All other symbols, such as ICartographicLineSymbol, IMarkerLineSymbol, IMultiLayerLineSymbol etc., are returned as esriSLSSolid symbol. In case of multi layer symbol, a simple line symbol with the properties from the first symbol’s layer of layer’s geometry type is returned.
Polygon symbols
- ISimpleFillSymbol is always returned as esriSFSSolid. Other types of simple fill symbols such as crossed, horizontal etc. are returned as esriSFSSolid type too. The outline symbol may be downgraded following above mentioned rules.
- A IPictureFillSymbol is returned as picture fill symbol. The server applies transparent, background & foreground colors, if any specified, to the output image.
- All other fill symbols including multi-layer symbols are returned as ISimpleFillSymbol with the properties from the first symbol’s layer of layer’s geometry type is returned.
Labels:
- LabelingDescription
is returned as a part of the FeatureLayerDrawingDescription.
This property is empty if
- any of the LabelClasses have a “WhereClause” (in ArcMap, it is called SQL Queries).
- advanced label expression is used.
- any of the LabelClasses contain unsupported keywords when conversion is requested.
- The label expressions in the LabelClassDescriptions can be
converted to MapServer label expression by setting the
ConvertLabelExpressions to True. Only label
expressions that conform to the following keywords are converted.
The following is the list of supported keywords:
Script Type Supported Keywords Converted Keywords VBScript Concatenation & CONCAT VBScript Newline vbNewline, vbLf, VbCrLf, vbCr NEWLINE VBScript Literals " " " " VBScript Functions FormatDateTime( [FieldName] , NamedFormat )
- vbGeneralDate
- vbLongDate
- vbShortDate
- vbLongTime
- vbShortTime
* please note the numeric values for these
VB constants are returned as it isFormatDate([Date_Time] , FormatString)
- "mm/dd/yy hh:mm:ss tt"
- "dddd, MMMM dd, yyyy"
- "mm/dd/yy"
- "hh:mm:ss tt"
- "h:mm"
UCase([FieldName]) UCASE([FieldName]) LCase([FieldName]) LCASE([FieldName]) Round([FieldName], n) ROUND([FieldName], n) JScript expressions are not supported for 10.0 - ConvertLabelExpressions can be set to False if
the clients want the original label expressions set in the
MapService whether it is VBScript or JScript.
- ITextSymbol’s background is ignored by the server. In case of highway shield, only the properties of text placed inside the shield will be returned and shield (background of the text symbol) itself will be ignored.
LabelPlacement
- Point label’s position could be one of 8 positions around a point. When a weight is set for each position in ArcMap, MapServer returns the position with priority 1. For example, when the label position is set to "Prefer Top Right, all allowed", the server will return esriServerPointLabelPlacementAboveRight
- Line label placements are simplified
into those listed in the esriServerLineLabelPlacementType
enumerators.
In ArcMap label positions are constrained by 2 different options. They are listed below. The list also shows what are they converted to by MapServer.
- Vertical position of the label
- Above/Top --> esriServerLinePlacementAbove*
- On the line --> esriServerLinePlacementCenter*
- Below/Right --> esriServerLinePlacementBelow*
When more than one options are checked in ArcMap, MapServer gives priority in the order they are listed above unless “Start Point Priorities” are blocked for that position.
- Position along the line
- At Best --> esriServerLinePlacement*Along
- At Start
- when "Before" has higher priority in "Start Point Priorities", MapServer returns esriServerLinePlacement*Before, or esriServerLinePlacement*Start is returned
- At End
- when "After" has higher priority in "Start Point Priorities", MapServer returns esriServerLinePlacement*After, or esriServerLinePlacement*End is returned
Here are few examples:
Example#1: check the screen shot below where in ArcMap (a) "Above" is checked, (b) "Location along the line" is "At Start" and (c) "Before" in "Start Point Priorities" has higher priority, MapServer returns esriServerLinePlacementAboveBefore.Example#2: check the screen shot below where in ArcMap (a) both "On the line" and "Below" positions are checked, (b) "Location along the line" is "At Start" and (c) "At" and "After" in "Start Point Priorities" have same higher priority than "Before", MapServer returns esriServerLinePlacementCenterStart .
- Vertical position of the label
- Polygon labels are always converted to horizontal labels.