agentleFS
geoai-latamgeoai-latam/SKILL_JS5_ARCGIS/skills/arcgis-embeddable-maps/SKILL.md

arcgis-embeddable-maps

Skill1 starsChanged 6 months agoMITView on GitHub

Embed a saved ArcGIS WebMap in any site with the ArcGIS Maps SDK for JavaScript 5.1 Embeddable Map: a CDN-only custom element (no npm package) loaded from its own script, js.arcgis.com/5.1/embeddable-components/ (the unified SDK script does not register it), plus an arcgis-embedded-map element with an item id. Tools are opt-in attributes (legend-enabled, bookmarks-enabled, ...). Use this skill whenever the user wants to embed or share a map with minimal code.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every tool attribute is a boolean that defaults to false: legend-enabled, bookmarks-enabled, basemap-gallery-enabled, heading-enabled, …

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Embeddable Maps

When to use: Activate this skill whenever the user wants to embed or share a saved WebMap with minimal code. Embeddable Maps are CDN-only — there is no npm package.

Overview

The Embeddable Map renders a saved WebMap from one script tag and one custom element.

  • Problem it solves: drop a configured map into any page without a build pipeline.
  • Who it serves: content authors and developers embedding maps quickly.
  • Pattern it teaches: the embeddable-components script + arcgis-embedded-map with an item-id.
  • What it does NOT cover: custom app logic (see arcgis-core-maps) or content discovery (arcgis-portal-content).

Quick Start

<script type="module" src="https://js.arcgis.com/5.1/embeddable-components/"></script>
<arcgis-embedded-map item-id="10f5128431d44f9180d9936834100ac5" legend-enabled></arcgis-embedded-map>

Measured with Chromium (2026-10-27): this registers the element and loads the public WebMap ("Educational Attainment and Household Size", 2 layers); el.webMap.loadStatus === "loaded".

Decision Tree

  1. Just need a saved map on a page?
    • Yes → Embeddable Map (its own script + element).
  2. Need custom layers/logic/interactions?
    • Yes → build with Map Components / Core API instead (see arcgis-core-maps).
  3. No build tooling available?
    • Yes → Embeddable Map (pure HTML/CDN). The full SDK also works from the CDN (https://js.arcgis.com/5.1/), but that script does not include arcgis-embedded-map.

Default: Embeddable Map for share/embed; the full SDK for custom apps.

Import Patterns

Direct ESM (recommended for npm/Vite/Webpack)

Not applicable: @arcgis/embeddable-components is not on npm (404, checked 2026-10-27).

Dynamic Imports (CDN)

<script type="module" src="https://js.arcgis.com/5.1/embeddable-components/"></script>

Map Components (recommended for new projects)

For full apps use @arcgis/map-components (arcgis-map). Embeddable Maps are for quick embeds.

Key Concepts

Concept 1: Its own CDN script

The embeddable components ship separately from the SDK: https://js.arcgis.com/5.1/embeddable-components/ (5.1). Measured: the unified https://js.arcgis.com/5.1/ script registers arcgis-map, charts and Calcite, but customElements.get("arcgis-embedded-map") stays undefined: the tag renders as an empty element, with no error. There is no npm package.

Concept 2: item-id drives everything

The item-id points to a saved WebMap; the element renders its basemap, layers and popups. The loaded WebMap is readable as el.webMap. portal-url points to ArcGIS Enterprise, and api-key carries a key for items or services that need one.

Concept 3: Tools are opt-in

Every tool attribute is a boolean that defaults to false: legend-enabled, bookmarks-enabled, basemap-gallery-enabled, heading-enabled, information-enabled, share-enabled, locate-enabled, track-enabled, floor-filter-enabled, time-zone-label-enabled, scroll-enabled (mouse-wheel zoom). The only negative one is fullscreen-disabled. theme is light or dark; center, scale and extent set the initial view.

Common Pitfalls (Top 3)

Pitfall 1: Loading the SDK script instead of the embeddable one

<!-- ❌ Anti-pattern -->
<script type="module" src="https://js.arcgis.com/5.1/"></script>
<arcgis-embedded-map item-id="..."></arcgis-embedded-map>
<!-- ✅ Correct -->
<script type="module" src="https://js.arcgis.com/5.1/embeddable-components/"></script>
<arcgis-embedded-map item-id="..."></arcgis-embedded-map>

Impact: measured: the element is never defined, the page shows an empty box and the console has no error. The same happens with /5.0/. Do not npm install it either: the package does not exist.

Pitfall 2: hide-* attributes

<!-- ❌ Anti-pattern -->
<arcgis-embedded-map item-id="..." hide-bookmarks></arcgis-embedded-map>
<!-- ✅ Correct -->
<arcgis-embedded-map item-id="..." legend-enabled></arcgis-embedded-map>

Impact: hide-legend, hide-bookmarks and hide-zoom are not attributes of the element (not in its observedAttributes) and do nothing. The legend and bookmarks are already off: measured legendEnabled and bookmarksEnabled are false unless you add the *-enabled attribute.

Pitfall 3: Private webmap without access

<!-- ❌ Anti-pattern -->
<arcgis-embedded-map item-id="<private-item>"></arcgis-embedded-map>
<!-- ✅ Correct -->
<!-- Share the item publicly, or pass an api-key whose privileges cover it. -->

Impact: the map fails to load for anonymous viewers (not measured here: no private item was used).

When to Read references/

If you need...Read
Element attributesreferences/api-detail.md
Embed / share examplesreferences/examples.md
More pitfalls (5+ extended)references/pitfalls.md

Related Skills

  • arcgis-portal-content — find the webmap item id
  • arcgis-core-maps — build a custom app instead
  • arcgis-widgets-ui — components for full apps

Reference Samples

Changelog

  • 0.2.0 (2026-10-27): SDK 5.1. The skill did not work: the unified js.arcgis.com/5.0/ script does not register arcgis-embedded-map (measured with 5.0 and 5.1: empty element, no error); the embeddable components have their own script, js.arcgis.com/5.1/embeddable-components/. The hide-* attributes do not exist: tools are opt-in *-enabled booleans, all false by default (legend and bookmarks were said to be on). The zero-height and duplicate-script pitfalls did not reproduce. Run in tests/runtime/embebido.mjs.
  • 0.1.0 (2026-05-31): Initial release.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.