require(["esri/symbols"], (symbols) => { /* code goes here */ });
import * as symbols from "@arcgis/core/symbols.js";
esri/symbols
A convenience module for importing Symbol classes when developing with TypeScript. For example, rather than importing symbols one at a time like this:
import SimpleFillSymbol from "esri/symbols/SimpleFillSymbol";
import SimpleMarkerSymbol from "esri/symbols/SimpleMarkerSymbol";
You can use this module to import them on a single line:
import { SimpleFillSymbol, SimpleMarkerSymbol } from "esri/symbols";
This module also allows you to implement type guards on geometries, making your code smarter.
import { Symbol } from "esri/symbols";
function logSymbol(symbol: Symbol): void {
if (symbol.type === "simple-marker") {
// new at 4.8, the compiler knows the symbol is a SimpleMarkerSymbol
console.log("symbol color: ", symbol.color);
}
else {
// the compiler knows the symbol must be one of the other symbols
console.log("symbol type: ", symbol.type);
}
}
- See also
-
- CIMSymbol
- ExtrudeSymbol3DLayer
- FillSymbol3DLayer
- IconSymbol3DLayer
- LineSymbol3DLayer
- ObjectSymbol3DLayer
- PathSymbol3DLayer
- TextSymbol3DLayer
- WaterSymbol3DLayer
- LabelSymbol3D
- LineSymbol3D
- MeshSymbol3D
- PointSymbol3D
- PolygonSymbol3D
- Font
- PictureFillSymbol
- PictureMarkerSymbol
- SimpleFillSymbol
- SimpleLineSymbol
- SimpleMarkerSymbol
- TextSymbol
- WebStyleSymbol
Type Definitions
-
CIMSymbol
CIMSymbol CIMSymbol
-
CIMSymbol.
-
ExtrudeSymbol3DLayer
ExtrudeSymbol3DLayer ExtrudeSymbol3DLayer
-
ExtrudeSymbol3DLayer.
-
FillSymbol
FillSymbol PictureFillSymbol |SimpleFillSymbol
-
FillSymbol types.
-
FillSymbol3DLayer
FillSymbol3DLayer FillSymbol3DLayer
-
FillSymbol3DLayer.
-
Font
Font Font
-
Font.
-
IconSymbol3DLayer
IconSymbol3DLayer IconSymbol3DLayer
-
IconSymbol3DLayer.
-
LabelSymbol3D
LabelSymbol3D LabelSymbol3D
-
LabelSymbol3D.
-
LineSymbol3D
LineSymbol3D LineSymbol3D
-
LineSymbol3D.
-
LineSymbol3DLayer
LineSymbol3DLayer LineSymbol3DLayer
-
LineSymbol3DLayer.
-
MarkerSymbol
MarkerSymbol PictureMarkerSymbol |SimpleMarkerSymbol
-
MarkerSymbol types.
-
MeshSymbol3D
MeshSymbol3D MeshSymbol3D
-
MeshSymbol3D.
-
ObjectSymbol3DLayer
ObjectSymbol3DLayer ObjectSymbol3DLayer
-
ObjectSymbol3DLayer.
-
PathSymbol3DLayer
PathSymbol3DLayer PathSymbol3DLayer
-
PathSymbol3DLayer.
-
PictureFillSymbol
PictureFillSymbol PictureFillSymbol
-
PictureFillSymbol.
-
PictureMarkerSymbol
PictureMarkerSymbol PictureMarkerSymbol
-
PictureMarkerSymbol.
-
PointSymbol3D
PointSymbol3D PointSymbol3D
-
PointSymbol3D.
-
PolygonSymbol3D
PolygonSymbol3D PolygonSymbol3D
-
PolygonSymbol3D.
-
SimpleFillSymbol
SimpleFillSymbol SimpleFillSymbol
-
SimpleFillSymbol.
-
SimpleLineSymbol
SimpleLineSymbol SimpleLineSymbol
-
SimpleLineSymbol.
-
SimpleMarkerSymbol
SimpleMarkerSymbol SimpleMarkerSymbol
-
SimpleMarkerSymbol.
-
Symbol
Symbol Symbol2D3D |WebStyleSymbol
-
Symbol types.
-
Symbol2D
Symbol2D PictureFillSymbol |PictureMarkerSymbol |SimpleFillSymbol |SimpleLineSymbol |SimpleMarkerSymbol |TextSymbol |CIMSymbol
-
Symbol2D types.
-
Symbol3D
Symbol3D LabelSymbol3D |LineSymbol3D |MeshSymbol3D |PointSymbol3D |PolygonSymbol3D
-
Symbol3D types.
-
Symbol3DLayer
Symbol3DLayer ExtrudeSymbol3DLayer |FillSymbol3DLayer |WaterSymbol3DLayer |IconSymbol3DLayer |LineSymbol3DLayer |ObjectSymbol3DLayer |PathSymbol3DLayer |TextSymbol3DLayer
-
Symbol3DLayer types.
-
TextSymbol
TextSymbol TextSymbol
-
TextSymbol.
-
TextSymbol3DLayer
TextSymbol3DLayer TextSymbol3DLayer
-
TextSymbol3DLayer.
-
WaterSymbol3DLayer
WaterSymbol3DLayer WaterSymbol3DLayer
-
WaterSymbol3DLayer.
-
WebStyleSymbol
WebStyleSymbol WebStyleSymbol
-
WebStyleSymbol.