Skip To ContentArcGIS for DevelopersSign In Dashboard
require(["esri/symbols/CIMSymbol"], function(CIMSymbol) { /* code goes here */ });
Class: esri/symbols/CIMSymbol
Inheritance: CIMSymbol Symbol Accessor
Since: ArcGIS API for JavaScript 4.12
beta

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 sepcification is supported. Please see Known Limitations below for more information.

Known Limitations

  • Currently, only CIMPointSymbol for Point geometry is supported.
  • Currently, CIMPictureMarker is not supported in 3D SceneView.
  • 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, CIMSymbol is not supported in Legend Widget.
  • Currently, bold and italic fontStyles are not supported.
  • PrimitiveOverrides does not work on all the properties
See also:
Example:
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 Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
Object

The JSON payload of the CIM symbol

more details
more detailsCIMSymbol
String

The name of the class.

more details
more detailsAccessor
String

The symbol type.

more details
more detailsCIMSymbol

Property Details

data Object

The JSON payload of the CIM symbol

declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

type Stringreadonly

The symbol type.

For CIMSymbol the type is always "cim".

Method Overview

NameReturn TypeSummaryClass
CIMSymbol

Creates a deep clone of the symbol.

more details
more detailsCIMSymbol
*

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 detailsSymbol
Object

Converts an instance of this class to its ArcGIS portal JSON representation.

more details
more detailsSymbol

Method Details

clone(){CIMSymbol}

Creates a deep clone of the symbol.

Returns:
TypeDescription
CIMSymbolA 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 Object

A 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:
TypeDescription
*Returns a new instance of this class.
toJSON(){Object}inherited

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.

Returns:
TypeDescription
ObjectThe ArcGIS portal JSON representation of an instance of this class.

API Reference search results

NameTypeModule
Loading...