Amap Jsapi Skill

Expert-level Gaode Map (AMap) JSAPI v2.0 integration for 3D maps, LBS services, and secure implementations.

Install
cmdop skills install agensi-amap-jsapi-skill

The Amap JSAPI Skill gives an AI agent deep, version-specific knowledge of the Gaode Map (AMap) JavaScript SDK v2.0, allowing it to generate correct, ready-to-use HTML and JavaScript code for interactive mapping applications.

The skill covers the full AMapLoader initialization pattern, including 3D view mode setup, proper viewport configuration, and clean WebGL memory disposal via map.destroy(). Security is handled at the v2.0 level: the skill knows how to configure AMap_SECURITY_JS_CODE and set up proxy-based service hosts, avoiding the “Invalid Key” and “Security Check” errors that arise when these steps are skipped or misconfigured.

For visual output, the agent can produce LabelMarkers with collision detection, vector overlays including Polylines, Polygons, and Circles, and custom layers using Canvas, WMS, or Three.js. On the services side, the skill covers reverse geocoding, driving, walking, and transit route planning, POI search, and address input auto-completion.

Output takes the form of self-contained HTML/JavaScript snippets or full components using ES modules or script loaders, with all logic scoped to the workspace directory. This skill is not a live API client and does not make calls to Gaode servers at runtime; it supplies coding knowledge rather than executing map queries directly.

Use cases

  • Generate a 3D map initialization component with correct AMapLoader patterns and WebGL lifecycle management
  • Produce secure v2.0 key configuration code including AMap_SECURITY_JS_CODE and proxy service host setup
  • Build a route-planning UI covering driving, walking, and transit modes using AMap route APIs
  • Add LabelMarker clusters with collision detection to a location-based web application
  • Implement reverse geocoding and POI search with address auto-completion in a web form
  • Create custom map layers using Canvas, WMS sources, or Three.js overlays on an AMap instance

When to use it

  • Building a web application that embeds Gaode Map JSAPI v2.0 and requires correct SDK initialization
  • Implementing AMap security configuration to avoid key validation errors in production
  • Generating vector overlay code (polygons, polylines, circles) for spatial data visualization
  • Integrating LBS services such as geocoding, route planning, or POI search into a frontend project

When not to use it

  • Projects that use a different mapping SDK such as Leaflet, Mapbox, or Google Maps — this skill is specific to AMap JSAPI v2.0
  • Server-side or backend map processing; the skill targets browser-based JavaScript
  • Use cases requiring live runtime API calls from an agent; the skill produces code, it does not execute map service requests
  • Applications targeting AMap JSAPI v1.x, which has a different API surface and security model