agentleFS
GeoDaoyuGeoDaoyu/arcgis-maps-sdk-js-ai-context/skills/arcgis-core-maps/AGENTS.md

arcgis-maps-sdk-js-ai-context / arcgis-core-maps

AGENTS.md0 starsChanged 7 months agoMITView on GitHub

Quick-reference decisions, checklists, and tables for creating 2D/3D maps. Default: Map Components unless you have a specific reason for Core API. ArcGIS uses [longitude, latitude], not [latitude, longitude].

  • Installs packages

The file

Files
AGENTS.md

Agent Guide: arcgis-core-maps

Quick-reference decisions, checklists, and tables for creating 2D/3D maps.

Map Components vs Core API Decision Tree

  1. Are you starting a new project?
    • Yes --> Use Map Components (<arcgis-map> / <arcgis-scene>)
    • No, maintaining existing Core API code --> Stay with Core API
  2. Do you need programmatic control over view construction timing?
    • Yes (e.g., dynamic container, conditional rendering) --> Core API (new MapView())
    • No --> Map Components
  3. Are you using a framework?
    • React 19 / Angular / Vue --> Map Components work as custom elements
    • Older React (<19) --> Core API (custom element event handling is limited)
  4. Do you need to embed the map inside a Calcite shell layout?
    • Yes --> Map Components with reference-element attribute for external widgets
    • No --> Either approach works

Default: Map Components unless you have a specific reason for Core API.

Setup Checklist

Map Components (npm)

  • npm install @arcgis/map-components @esri/calcite-components
  • Import components: import "@arcgis/map-components/dist/components/arcgis-map"
  • Set Calcite asset path: setAssetPath("https://js.arcgis.com/calcite-components/3.3.3/assets")
  • Set API key: esriConfig.apiKey = "YOUR_KEY"
  • Ensure html, body { height: 100%; margin: 0; } in CSS
  • Set "moduleResolution": "bundler" in tsconfig.json
  • Use arcgisViewReadyChange event before accessing view

Core API (npm)

  • npm install @arcgis/core
  • Import CSS: @import "@arcgis/core/assets/esri/themes/light/main.css"
  • Create container div with full height: #viewDiv { height: 100%; }
  • Import classes: import Map from "@arcgis/core/Map.js"
  • Set API key: esriConfig.apiKey = "YOUR_KEY"
  • Await view.when() before accessing view properties

Map Components (CDN)

  • Add Calcite script: <script type="module" src="https://js.arcgis.com/calcite-components/3.3.3/calcite.esm.js"></script>
  • Add SDK script: <script src="https://js.arcgis.com/5.0/"></script>
  • Add components script: <script type="module" src="https://js.arcgis.com/5.0/map-components/"></script>
  • Use <arcgis-map> or <arcgis-scene> in HTML
  • Use $arcgis.import() for dynamic imports inside <script type="module">

Core API (CDN)

  • Add CSS: <link rel="stylesheet" href="https://js.arcgis.com/5.0/esri/themes/light/main.css" />
  • Add SDK script: <script src="https://js.arcgis.com/5.0/"></script>
  • Create #viewDiv with full height
  • Use <script type="module"> for async/await support

CDN vs npm Comparison

AspectCDNnpm + Build Tool
Setup speedFastest (3 script tags)Requires project scaffolding
Tree-shakingNo (loads full SDK)Yes (smaller bundles)
TypeScriptNo type checkingFull type support
Offline devNoYes
Production usePrototypes and demosRecommended
Import style$arcgis.import()import X from "@arcgis/core/..."
CSS handlingManual link tag (Core API)@import in CSS (Core API), automatic (Components)
VersioningURL-pinned (/5.0/)package.json pinned

Quick Reference: Coordinate Order

ArcGIS uses [longitude, latitude], not [latitude, longitude].

center: [-118.24, 34.05]  // Los Angeles: longitude first, latitude second

Quick Reference: View Containers

ContainerDimensionClass
<arcgis-map>2DWeb component (MapView internally)
<arcgis-scene>3DWeb component (SceneView internally)
<arcgis-video>VideoWeb component (VideoView internally)
new MapView()2DCore API
new SceneView()3DCore API

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.