ESM: import IconSymbol3DLayer from "@arcgis/core/symbols/IconSymbol3DLayer.js";
CDN: const IconSymbol3DLayer = await $arcgis.import("@arcgis/core/symbols/IconSymbol3DLayer.js");
Class: @arcgis/core/symbols/IconSymbol3DLayer
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.
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.
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
new IconSymbol3DLayer(properties)
Parameter
optionalSee the properties for a list of all the properties that may be passed into the constructor.
Show inherited properties Hide inherited properties
Property DetailsThe 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"
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
.
Value defining the position relative to the icon's width.
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
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.
Example
// rotation angle in degree
symbolLayer.angle = 45;
Inherited
Property declaredClass Stringreadonly
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
.
The material used to shade the icon. This property defines the icon's color.
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
}
};
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.
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.
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"
};
The shape (primitive
) or image URL (href
) used to visualize the features. If both properties are present, href
takes precedence and primitive
is ignored.
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.
Possible Values:"x"|"cross"|"square"|"circle"|"triangle"|"kite"
href String|null|undefinedThe 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"
};
The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. 12px
).
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
Show inherited methods Hide inherited methods
Method DetailsInherited
Method addHandles(handleOrHandles, groupKey)
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
Handles marked for removal once the object is destroyed.
groupKey *
optionalKey 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.
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();
Inherited
Method fromJSON(json){* |null |undefined}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.
Returns
Type Description * | null | undefined Returns a new instance of this class.Inherited
Method hasHandles(groupKey){Boolean}
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 *
optionalA group key.
Returns
Type Description Boolean Returnstrue
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");
}
Inherited
Method removeHandles(groupKey)
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 *
optionalA 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");
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4