<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Urban visualizations with polygon patterns | 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.1/"></script>
<arcgis-scene item-id="b7ede4ddceb44073b06081de80cfd150">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-navigation-toggle slot="top-left"></arcgis-navigation-toggle>
<arcgis-compass slot="top-left"></arcgis-compass>
<arcgis-legend slot="top-right"></arcgis-legend>
<calcite-card slot="bottom-left">
>Select pattern for urban renewal area
<calcite-select id="patterns" value="cross">
<calcite-option value="none">None</calcite-option>
<calcite-option value="backward-diagonal">backward-diagonal</calcite-option>
<calcite-option value="cross" selected>cross</calcite-option>
<calcite-option value="diagonal-cross">diagonal-cross</calcite-option>
<calcite-option value="forward-diagonal">forward-diagonal</calcite-option>
<calcite-option value="horizontal">horizontal</calcite-option>
<calcite-option value="vertical">vertical</calcite-option>
const [FeatureLayer] = await $arcgis.import(["@arcgis/core/layers/FeatureLayer.js"]);
// Get a reference to Scene component
const viewElement = document.querySelector("arcgis-scene");
// Overlay color for the urban renewal area
const overlayColor = "#cf385b";
// Create the overlay FeatureLayer with a 3D polygon symbol and pattern
const overlay = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/SouthBostonDotAve_Scenario2ProposedZoneChange/FeatureServer/4",
material: { color: overlayColor },
outline: { color: overlayColor },
title: "Urban Renewal Area Overlay",
// Wait for the view to initialize
await viewElement.viewOnReady();
// Add the overlay layer to the map
viewElement.map.add(overlay);
// Listen for pattern changes and update the renderer
document.getElementById("patterns").addEventListener("calciteSelectChange", (event) => {
const renderer = overlay.renderer.clone();
renderer.symbol.symbolLayers.getItemAt(0).pattern = {
style: event.target.value,
overlay.renderer = renderer;