IconSymbol3DLayer

require(["esri/symbols/IconSymbol3DLayer"], function(IconSymbol3DLayer) { /* code goes here */ });
Class: esri/symbols/IconSymbol3DLayer
Inheritance: IconSymbol3DLayer Symbol3DLayer Accessor
Since: ArcGIS API 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. Icon color and size can also be data-driven by adding size and/or color 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 iconsBillboarded icons
symbols-drapedsymbols-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.

Autocasting support

As of version 4.5 of the ArcGIS API for JavaScript, autocasting is universally supported for all renderers, symbols, and symbol layers in the API. So there is no need to include this module in the require() and define() module loaders of your application unless you intend to use the static method(s) of this module.

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

Constructors

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.
NameTypeSummaryClass
String

The positioning of the icon relative to the geometry.

more details
more detailsIconSymbol3DLayer
String

The name of the class.

more details
more detailsAccessor
Object

The material used to shade the icon.

more details
more detailsIconSymbol3DLayer
Object

The outline of the icon.

more details
more detailsIconSymbol3DLayer
Object

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

more details
more detailsIconSymbol3DLayer
Number

The size of the icon in points.

more details
more detailsIconSymbol3DLayer
String

For IconSymbol3DLayer the type is always icon.

more details
more detailsIconSymbol3DLayer

Property Details

anchorString

The positioning of the icon relative to the geometry.

Possible values: center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right

Default Value:center
declaredClassStringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

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

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

Property:
color Color
optional
Default Value:white
Autocasts from Object|Number[]|String

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

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
  }
};

The outline of the icon.

Properties:
color Color
optional
Default Value:black
Autocasts from Object|Number[]|String

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

size Number
optional
Default Value:1.125
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"
};
resourceObject

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
optional

Uses a built-in shape. See the table below for list of possible values.

ValueDescription
circles3d-icon-circle
squares3d-icon-square
crosss3d-icon-cross
xs3d-icon-x
kites3d-icon-kite
href String
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. SVG is not supported in IE11.

Default Value:{ primitive: "circle" }
Example:
symbolLayer.resource = {
  primitive: "cross"
};
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
typeStringreadonly

For IconSymbol3DLayer the type is always icon.

Method Overview

NameReturn TypeSummaryClass
IconSymbol3DLayer

Creates a deep clone of the symbol layer.

more details
more detailsIconSymbol3DLayer
*

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

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

more details
more detailsSymbol3DLayer

Method Details

Creates a deep clone of the symbol layer.

Returns:
TypeDescription
IconSymbol3DLayerA deep clone of the object that invoked this method.
Example:
// Creates a deep clone of the graphic's first symbol layer
var symLyr = graphic.symbol.symbolLayers.getItemAt(0).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...