<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Flat vs. volumetric 3D symbol layers | Sample | ArcGIS Maps SDK for JavaScript</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
<script type="module" src="https://js.arcgis.com/5.0/"></script>
--calcite-color-text-1: #ffffff;
--calcite-panel-background-color: #000000;
basemap="dark-gray-vector"
camera-position="-81.76, 16.77, 1932626"
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-navigation-toggle slot="top-left"></arcgis-navigation-toggle>
<arcgis-compass slot="top-left"></arcgis-compass>
<calcite-panel slot="top-right" id="panel">
<calcite-label>Show points as:</calcite-label>
<calcite-radio-button-group name="symbolType" layout="vertical">
<calcite-label layout="inline">
<calcite-radio-button value="icon" checked></calcite-radio-button>
<calcite-label layout="inline">
<calcite-radio-button value="object"></calcite-radio-button>
</calcite-radio-button-group>
const [FeatureLayer, LabelClass] = await $arcgis.import([
"@arcgis/core/layers/FeatureLayer.js",
"@arcgis/core/layers/support/LabelClass.js",
/*****************************************************************
* Get a reference to the HTML elements
*****************************************************************/
const viewElement = document.querySelector("arcgis-scene");
// Wait for the view to initialize
await viewElement.viewOnReady();
// Create iconSymbol and add to renderer
type: "point-3d", // autocasts as new PointSymbol3D()
type: "icon", // autocasts as new IconSymbol3DLayer()
const iconSymbolRenderer = {
type: "simple", // autocasts as new SimpleRenderer()
// Create objectSymbol and add to renderer
type: "point-3d", // autocasts as new PointSymbol3D()
type: "object", // autocasts as new ObjectSymbol3DLayer()
const objectSymbolRenderer = {
type: "simple", // autocasts as new SimpleRenderer()
const labelClass = new LabelClass({
type: "label-3d", // autocasts as new LabelSymbol3D()
type: "text", // autocasts as new TextSymbol3DLayer()
labelPlacement: "above-center",
expression: 'DefaultValue($feature.CITY_NAME, "no data")',
// Request feature layers and overwrite renderer
const featureLayer = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/CITIES_EastUSA/FeatureServer/0",
renderer: iconSymbolRenderer,
outFields: ["CITY_NAME"],
// Ensure that all features are shown at all scales
labelingInfo: [labelClass],
viewElement.map.add(featureLayer);
// Register the events listener to toggle between objectSymbol and iconSymbol
const radioButtonGroup = document.querySelector("calcite-radio-button-group");
// Add an event listener for the change event
radioButtonGroup.addEventListener("calciteRadioButtonChange", (event) => {
if (event.target.value === "icon") {
featureLayer.renderer = iconSymbolRenderer;
featureLayer.renderer = objectSymbolRenderer;