IconSymbol3DLayer

AMD: require(["esri/symbols/IconSymbol3DLayer"], (IconSymbol3DLayer) => { /* code goes here */ });
ESM: import IconSymbol3DLayer from "@arcgis/core/symbols/IconSymbol3DLayer.js";
Class: esri/symbols/IconSymbol3DLayer
Inheritance: IconSymbol3DLayerSymbol3DLayerAccessor
Since: ArcGIS Maps SDK for JavaScript 4.0

IconSymbol3DLayer is used to render Point geometries using a flat 2D icon (e.g. a circle) with a PointSymbol3D in a SceneView. MapView does not support 3D symbols. Polygon features may also be rendered with IconSymbol3DLayers, but the icon symbol layer must be contained within a PolygonSymbol3D, not a PointSymbol3D in that scenario.

The shape of the icon is set in the resource property and the color is set in the material property. Size may be defined in points or pixels with the size property. The angle property allows to rotate the icons clockwise by specifying a number in degree.

Icon color, angle and size can also be data-driven by adding color visual variables, rotation visual variables and/or size visual variables to any Renderer that uses this symbol layer.

IconSymbol3DLayers must be added to the symbolLayers property of either the PointSymbol3D or PolygonSymbol3D symbols. Multiple symbol layers may be used in a single symbol.

Because icon symbol layers are defined in screen space (pixels/points), they can either be draped on the terrain, or billboarded in the view. Billboarded icons allow the symbol to face the user at all times as long as it is visible in to the camera. This is particularly apparent with tilted views. Draped icons drape the symbols on the surface of the terrain.

Draped icons Billboarded icons
symbols-draped symbols-billboarded

The ability to drape and billboard icons is controlled in the elevationInfo property of the FeatureLayer. Setting the mode to on-the-ground drapes the icons, whereas setting it to relative-to-ground billboards them.

See Symbol3DLayer and Symbol3D to read more general information about 3D symbols, symbol layers and how they relate to one another.

See also
Example
let symbol = {
  type: "point-3d",  // autocasts as new PointSymbol3D()
  symbolLayers: [{
    type: "icon",  // autocasts as new IconSymbol3DLayer()
    rotation: 90, // degree
    size: 8,  // points
    resource: { primitive: "circle" },
    material: { color: "red" }
  }]
};

Constructors

IconSymbol3DLayer

Constructor
new IconSymbol3DLayer(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.
Show inherited properties Hide inherited properties
Name Type Summary Class

The positioning of the icon relative to the geometry.

IconSymbol3DLayer

Defines the anchor relative to the center of the icon.

IconSymbol3DLayer

The clockwise rotation angle of the icon in degrees.

IconSymbol3DLayer

The name of the class.

Accessor

The material used to shade the icon.

IconSymbol3DLayer

The outline of the icon.

IconSymbol3DLayer

The shape (primitive) or image URL (href) used to visualize the features.

IconSymbol3DLayer

The size of the icon in points.

IconSymbol3DLayer

The symbol type.

IconSymbol3DLayer

Property Details

anchor

Property
anchor String

The positioning of the icon relative to the geometry.

The anchor is also the centre of rotation when using angle to rotate the icon.

Possible Values:"center" |"left" |"right" |"top" |"bottom" |"top-left" |"top-right" |"bottom-left" |"bottom-right" |"relative"

Default Value:"center"

anchorPosition

Property
anchorPosition Object
Since: ArcGIS Maps SDK for JavaScript 4.11 IconSymbol3DLayer since 4.0, anchorPosition added at 4.11.

Defines the anchor relative to the center of the icon. It is specified as a ratio of the icon's dimensions. For example, a value of { x: 0, y: 0 } designates the center of the icon, while a value of { x: -0.5, y: -0.5 } causes the top-left corner of the icon to coincide with the feature geometry.

This property only applies when anchor is set to relative.

Properties
x Number

Value defining the position relative to the icon's width.

y Number

Value defining the position relative to the icon's height.

Examples
symbolLayer.anchor = "relative";
symbolLayer.anchorPosition = { x: 0, y: 0.5 }; // equivalent to `anchor: "bottom"`
symbolLayer.anchor = "relative";
symbolLayer.anchorPosition = { x: 1.5, y: 1 }; // the anchor can be placed outside of the icon

angle

Property
angle Number
Since: ArcGIS Maps SDK for JavaScript 4.31 IconSymbol3DLayer since 4.0, angle added at 4.31.

The clockwise rotation angle of the icon in degrees.

In a SceneView, icon rotation can be either screen-aligned (icons maintain a constant orientation relative to the screen, regardless of map movements) or map-aligned (icons rotate in conjunction with the map). For example, a map-aligned arrow icon placed on a road will consistently point along the road's direction, even as the map is rotated or tilted.

This behavior depends on the mode property within the elevationInfo. When set to on-the-ground, icons are draped onto the terrain, resulting in map-aligned rotation. Otherwise, icons are billboarded, maintaining a screen-aligned rotation.

Default Value:0
Example
// rotation angle in degree
symbolLayer.angle = 45;

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.7 Accessor since 4.0, declaredClass added at 4.7.

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

material

Property
material Objectautocast

The material used to shade the icon. This property defines the icon's color.

Property
optional
Autocasts from Object|Number[]|String

The fill color of the icon. If the icon uses an image as resource, each pixel of the image will be multiplied by this color. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, an object with r, g, b, and a properties, or a Color object.

Examples
// CSS color string
symbolLayer.material = {
  color: "dodgerblue"
};
// HEX string
symbolLayer.material = {
  color: "#33cc33";
}
// array of RGBA values
symbolLayer.material = {
  color: [51, 204, 51, 0.3];
}
// object with rgba properties
symbolLayer.material = {
  color: {
    r: 51,
    g: 51,
    b: 204,
    a: 0.7
  }
};

outline

Property
outline Objectautocast

The outline of the icon. The color property of this object directly modifies the overall color of IconSymbol3DLayer defined with the cross or x primitive.

Properties
optional
Autocasts from Object|Number[]|String

The color of the outline. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, an object with r, g, b, and a properties, or a Color object.

size Number
optional
Autocasts from Number|String

The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. 12px).

Example
symbolLayer.outline = {
  color: "blue",
  size: "0.5px"
};

resource

Property
resource Object

The shape (primitive) or image URL (href) used to visualize the features. If both properties are present, href takes precedence and primitive is ignored.

Properties
primitive String|null|undefined
optional

Uses a built-in shape. Note that when using the cross or x primitive, the outline property has to be defined to make the symbol visible. See the table below for list of possible values.

Value Description
circle s3d-icon-circle
square s3d-icon-square
cross s3d-icon-cross
x s3d-icon-x
kite s3d-icon-kite
triangle s3d-icon-triangle
optional

The URL or data URI for the image. If the external resource is an SVG then the SVG root node must have a set width and height, otherwise it will not render at the correct size.

Default Value:{ primitive: "circle" }
Example
symbolLayer.resource = {
  primitive: "triangle"
};

size

Property
size Numberautocast
Autocasts from Number|String

The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. 12px).

Default Value:12
Examples
// size in points
symbolLayer.size = 14;
// size in pixels
symbolLayer.size = "20px"; // autocasts to number
// size in points
symbolLayer.size = "14pt"; // autocasts to number

type

Property
type Stringreadonly

The symbol type.

For IconSymbol3DLayer the type is always "icon".

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor

Creates a deep clone of the symbol layer.

IconSymbol3DLayer
*

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product.

Symbol3DLayer

Returns true if a named group of handles exist.

Accessor

Removes a group of handles owned by the object.

Accessor

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

Symbol3DLayer

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

clone

Method
clone(){IconSymbol3DLayer}

Creates a deep clone of the symbol layer.

Returns
Type Description
IconSymbol3DLayer A deep clone of the object that invoked this method.
Example
// Creates a deep clone of the graphic's first symbol layer
let symLyr = graphic.symbol.symbolLayers.at(0).clone();

fromJSON

Inherited
Method
fromJSON(json){*}static

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. 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
Type Description
* Returns a new instance of this class.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

toJSON

Inherited
Method
toJSON(){Object}
Inherited from Symbol3DLayer

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

Returns
Type Description
Object The ArcGIS portal JSON representation of an instance of this class.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.