<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Popup dock positions | 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>
margin: -40px 0 0 -125px;
<!-- Note: popup-component-enabled enables the Popup component (beta). See https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/#popupComponentEnabled for details. -->
<arcgis-map item-id="22d8463bdf79468cb5824391088cf150" popup-component-enabled>
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand slot="bottom-right">
<arcgis-legend></arcgis-legend>
<div class="docking-control">
<calcite-label for="doc-position-select"
<calcite-select id="dock-position-select">
<calcite-option value="auto">Auto</calcite-option>
<calcite-option value="top-left">Top left</calcite-option>
<calcite-option value="top-center">Top center</calcite-option>
<calcite-option value="top-right">Top right</calcite-option>
<calcite-option value="bottom-left">Bottom Left</calcite-option>
<calcite-option value="bottom-center">Bottom Center</calcite-option>
<calcite-option value="bottom-right">Bottom Right</calcite-option>
<calcite-option value="top-start">Top Start</calcite-option>
<calcite-option value="top-end">Top End</calcite-option>
<calcite-option value="bottom-start">Bottom Start</calcite-option>
<calcite-option value="bottom-end">Bottom End</calcite-option>
// Get a reference to the map and popup components
const viewElement = document.querySelector("arcgis-map");
// Wait for when the component is ready
await viewElement.viewOnReady();
viewElement.popupElement.dockEnabled = true;
viewElement.popupElement.hideCloseButton = true;
viewElement.popupElement.hideActionBar = true;
viewElement.popupElement.dockOptions = {
// Removes the dock button from the popup
// Ignore the default sizes that trigger responsive docking
const centerPoint = viewElement.center.clone();
viewElement.popupElement.location = centerPoint;
viewElement.popupElement.heading = "Popup dock positions";
viewElement.popupElement.content =
"Use the control in the center of the map to change the location where the popup will dock.";
viewElement.popupElement.open = true;
const selectNode = document.getElementById("dock-position-select");
// Let user change the position dockOptions.position property of the
// popup at runtime from the drop-down list.
selectNode.addEventListener("calciteSelectChange", (event) => {
viewElement.popupElement.dockOptions = {
position: event.target.value,