Using Esri Icon Fonts with map graphics

Loading...

Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

When the ArcGIS API for JavaScript stylesheet https://js.arcgis.com/4.9/esri/css/main.css is included in a web page, the Esri Icon Fonts are immediately available for use. One potential use of the Esri Icon Fonts is to use them as symbol property of Graphic. In the code snippet below a TextSymbol is created by specifying the color, text, and font. The font property is created by autocasting the Font Class.

var textSymbol = {
  type: "text",  // autocasts as new TextSymbol()
  color: "#7A003C",
  text: "\ue61d", // esri-icon-map-pin
  font: { // autocast as esri/symbols/Font
    size: 20,
    family: "CalciteWebCoreIcons"
  }
};

Sample search results

TitleSample
Loading...