Returns information about layer renderers, symbols, and labels.
GetDefaultLayerDrawingDescriptions(String MapName, int[] LayerIDs, ServerSymbolOutputOptions OutputOptions)
Parameter |
Description |
MapName
|
The name of the map (data frame) that contains the layer associated with the LayerDescription parameter. |
LayerIDs |
Array of Layer IDs for which LayerDescriptions will be returned. |
OutputOptions |
Output image type. |
Return Value
An array of LayerDrawingDescription 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 of LayerDrawingDescription. If any ID is passed in that is neither of a FeatureLayer nor of an existing layer, no LayerDrawingDescription will be returned for that ID.
Remarks
You may want to use MapLayerInfo.HasLayerDrawingDescription
to check whether a map service will return a LayerDrawingDescription
for a layer.
The OutputOptions parameter can be null, in
that case a map service returns images in PNG format. In absence of an
output directory images are returned as PNG mime.
A LayerDrawingDescription
object contains information on the symbology and labels 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 ArcGIS Server map services only return the following:
Types of renderers:
Data exclusion from renderer
is not currently supported
Types of symbols
Point features
Line features
Polygon features
If a layer’s renderer is not one of those supported one, nothing will be
returned. Symbols that are not the supported are downgraded a supported
one. Please see the rules below.
A layer's symbols are downgraded as follows:
Point symbols
Simple
marker symbols are returned using the following types:
Any
other types such as picture marker symbol, character marker symbol, multi
layer symbol, etc. are returned as picture marker symbols with a url pointing
to an image file.
Line symbols
Simple line symbols are returned
as is. The following are supported:
All
other symbols, such as cartographic line symbol, marker line symbol, multilayer
line symbol etc., are returned as simple solid line 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
Simple fill symbols are always returned as solid fills. Other types of simple fill symbols such as crossed, horizontal etc. are returned as solid fill symbol type. The outline symbol may be downgraded following above mentioned rules.
A picture fill symbol is returned as picture fill symbol with a URI pointing to an image file. 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 simple fill symbols 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 FeatureLayerDrawingDescriptions. This property is empty if:
any of the label classes have a “WhereClause” (in ArcMap, it termed a SQL Query).
an advanced label expression is used.
any of the label classes
contain unsupported keywords when conversion is requested.
The label expressions in a LabelClassDescription can be converted to a Label Expression by setting the ServerSymbolOutputOptions.ConvertLabelExpressions to true. Only label expressions that conform to the following keywords are converted:
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 Note the numeric values for these VB constants
are returned as it is |
FormatDate([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 |
Not supported |
ServerSymbolOutputOptions.ConvertLabelExpressions can be set to false if the clients want the original label expressions set in the map service whether it is VBScript or JScript.
TextSymbol’s
background is ignored by the server. For example, only the properties
of text placed inside a highway shield will be returned and shield (background
of the text symbol) itself will be ignored.
Label Placement
Point label’s position
could be one of 8 positions around a point. When a weight is set for each
position in ArcMap, ArcGIS Server returns the position that has the highest
priority. 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 listed below. The list also shows what are they converted to by a map service.
Vertical position of the label
Above/Top - esriServerLinePlacementAbove
On the line - esriServerLinePlacementCenter
Below/Right - esriServerLinePlacementBelow. When more than one options are checked in ArcMap, A map service gives priority in the order they are listed above unless “Start Point Priorities” are blocked for that position.
Position along the line
At Best - esriServerLinePlacementAlong
At Start - when “Before” has higher priority in “Start Point Priorities”, a map service returns esriServerLinePlacement*Before, or esriServerLinePlacement*Start is returned.
At End - when “After”
has higher priority in “Start Point Priorities”, a map service returns
esriServerLinePlacement*After, or esriServerLinePlacement*End is returned
Here are few examples:
Example #1: See 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,
the map service returns esriServerLinePlacementAboveBefore.
Example #2: See 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”, the map service
returns esriServerLinePlacementCenterStart.
Polygon labels are always converted to horizontal labels.
Examples
C# |
VB.NET |
Java |