symbols
require(["esri/symbols"], function(symbols) { /* code goes here */ });
Object:
esri/symbols
Since: ArcGIS API for JavaScript 4.8
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 = require("esri/symbols/SimpleFillSymbol");
import SimpleMarkerSymbol = require("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:
- ExtrudeSymbol3DLayer
- FillSymbol3DLayer
- IconSymbol3DLayer
- LineSymbol3DLayer
- ObjectSymbol3DLayer
- PathSymbol3DLayer
- TextSymbol3DLayer
- LabelSymbol3D
- LineSymbol3D
- MeshSymbol3D
- PointSymbol3D
- PolygonSymbol3D
- Font
- PictureFillSymbol
- PictureMarkerSymbol
- SimpleFillSymbol
- SimpleLineSymbol
- SimpleMarkerSymbol
- TextSymbol
- WebStyleSymbol
Type Definitions
- ExtrudeSymbol3DLayerExtrudeSymbol3DLayer
ExtrudeSymbol3DLayer.
FillSymbol types.
- FillSymbol3DLayerFillSymbol3DLayer
FillSymbol3DLayer.
- FontFont
Font.
- IconSymbol3DLayerIconSymbol3DLayer
IconSymbol3DLayer.
- LabelSymbol3DLabelSymbol3D
LabelSymbol3D.
- LineSymbol3DLineSymbol3D
LineSymbol3D.
- LineSymbol3DLayerLineSymbol3DLayer
LineSymbol3DLayer.
MarkerSymbol types.
- MeshSymbol3DMeshSymbol3D
MeshSymbol3D.
- ObjectSymbol3DLayerObjectSymbol3DLayer
ObjectSymbol3DLayer.
- PathSymbol3DLayerPathSymbol3DLayer
PathSymbol3DLayer.
- PictureFillSymbolPictureFillSymbol
PictureFillSymbol.
- PictureMarkerSymbolPictureMarkerSymbol
PictureMarkerSymbol.
- PointSymbol3DPointSymbol3D
PointSymbol3D.
- PolygonSymbol3DPolygonSymbol3D
PolygonSymbol3D.
- SimpleFillSymbolSimpleFillSymbol
SimpleFillSymbol.
- SimpleLineSymbolSimpleLineSymbol
SimpleLineSymbol.
- SimpleMarkerSymbolSimpleMarkerSymbol
SimpleMarkerSymbol.
Symbol types.
Symbol2D types.
Symbol2D3D types.
Symbol3D types.
Symbol3DLayer types.
- TextSymbolTextSymbol
TextSymbol.
- TextSymbol3DLayerTextSymbol3DLayer
TextSymbol3DLayer.
- WebStyleSymbolWebStyleSymbol
WebStyleSymbol.
Loading...