CIMSymbol
require(["esri/symbols/CIMSymbol"], function(CIMSymbol) { /* code goes here */ });
esri/symbols/CIMSymbol
CIM symbols are used to display multi-layer vector symbols for features and graphics in MapView. CIM symbols can be created from CIMSymbolReference JSON that complies with the CIM specification by passing the JSON to the data property or from WebStyleSymbols
This module is currently in beta. Not all properties in the CIM specification are supported.
Known Limitations
- Currently, only CIMPointSymbol for Point geometry is supported.
curvedRings
is not currently supported.- Currently,
color
property expects an array of numbers [r, g, b, a] which is different from the CIM Specification. - Currently,
bold
anditalic
fontStyles are not supported. - PrimitiveOverrides does not work on all the properties
- See also:
const symbol = {
type: "cim", // autocasts as new CIMSymbol()
data: {
type: "CIMPointSymbol",
symbolLayers: [
{
type: "CIMVectorMarker",
enable: true,
size: 10,
frame: {
xmin: 0,
ymin: 0,
xmax: 17,
ymax: 17
},
markerGraphics: [
{
type: "CIMMarkerGraphic",
geometry: {
rings: [
[
[17, 17],
[0, 17],
[0, 0],
[17,0],
[17, 17]
]
]
},
symbol: {
type: "CIMPolygonSymbol",
symbolLayers: [
{
type: "CIMSolidStroke",
enable: true,
width: 0.5,
color: [219, 151, 147, 255]
}
]
}
}
],
}
],
}
};
Constructors
- new CIMSymbol(properties)
- Parameter:properties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
Object | The JSON payload of the CIM symbol more details | more details | CIMSymbol | |
String | The name of the class. more details | more details | Accessor | |
String | The symbol type. more details | more details | CIMSymbol |
Property Details
- data Object
The JSON payload of the CIM symbol
The name of the class. The declared class name is formatted as
esri.folder.className
.
Method Overview
Name | Return Type | Summary | Class | |
---|---|---|---|---|
CIMSymbol | Creates a deep clone of the symbol. more details | more details | CIMSymbol | |
* | Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. more details | more details | Symbol | |
Object | Converts an instance of this class to its ArcGIS portal JSON representation. more details | more details | Symbol |
Method Details
- clone(){CIMSymbol}
Creates a deep clone of the symbol.
Returns:Type Description CIMSymbol A deep clone of the object that invoked this method. Example:// Creates a deep clone of the graphic's symbol var symLyr = graphic.symbol.clone();
- fromJSON(json){*}static
Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input
json
parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameter:json ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
Returns:Type Description * Returns a new instance of this class.
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.
Returns:Type Description Object The ArcGIS portal JSON representation of an instance of this class.