Skip to content

Instantly share code, notes, and snippets.

@odoe
Created March 28, 2024 23:15
Show Gist options
  • Save odoe/523cced3a1390cbb4609b11c824de184 to your computer and use it in GitHub Desktop.
Save odoe/523cced3a1390cbb4609b11c824de184 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
<title>Map components AMD template</title>
<link rel="icon" href="data:;base64,=" />
<style>
html,
body {
background-color: var(--calcite-ui-foreground-2);
padding: 0;
margin: 0;
width: 100vw;
height: 100vh;
}
</style>
<!-- Load the ArcGIS Maps SDK for JavaScript -->
<link rel="stylesheet" href="https://js.arcgis.com/4.29/esri/themes/dark/main.css" />
<script src="https://js.arcgis.com/4.29/"></script>
</head>
<body>
<arcgis-map item-id="d5dda743788a4b0688fe48f43ae7beb9">
<arcgis-expand position="top-right">
<arcgis-search></arcgis-search>
</arcgis-expand>
<arcgis-legend position="bottom-left"></arcgis-legend>
</arcgis-map>
<script type="module">
async function load() {
const IdentityManager = await $arcgis.import(
"esri/identity/IdentityManager",
);
const OAuthInfo = await $arcgis.import("esri/identity/OAuthInfo");
console.log(IdentityManager, OAuthInfo);
// I can register my OAuthInfo here
// The custom element is not defined yet
console.log(customElements.get("arcgis-map"));
}
load().then(() => {
console.log("Loaded");
import(
"https://js.arcgis.com/map-components/4.29/arcgis-map-components.esm.js"
);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment