$npx -y skills add awslabs/agent-plugins --skill amazon-location-serviceIntegrates Amazon Location Service APIs for AWS applications. Use this skill when users want to add maps (interactive MapLibre or static images); geocode addresses to coordinates or reverse geocode coordinates to addresses; calculate routes, travel times, or service areas; find p
| 1 | ## Overview |
| 2 | |
| 3 | Amazon Location Service provides geospatial APIs for maps, geocoding, routing, places search, geofencing, and tracking. Prefer the bundled JavaScript client (@aws/amazon-location-client) for web development and use resourceless API operations to avoid managing AWS resources. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | Use this skill when: |
| 8 | |
| 9 | - Building location-aware web or mobile applications |
| 10 | - Working with Amazon Location Service projects |
| 11 | - Implementing maps, geocoding, routing, or places search |
| 12 | - Adding geofencing or device tracking functionality |
| 13 | - Integrating geospatial features into AWS applications |
| 14 | |
| 15 | Do NOT use this skill for: |
| 16 | |
| 17 | - Google Maps, Mapbox, or Leaflet-with-OSM projects (unless migrating to Amazon Location) |
| 18 | - Generic GIS operations without AWS context |
| 19 | - Non-AWS geospatial services |
| 20 | |
| 21 | ## Amazon Location Service API Overview |
| 22 | |
| 23 | **Places** (SDK: geo-places, JS: @aws-sdk/client-geo-places) |
| 24 | |
| 25 | - Geocode (Forward/Reverse): Convert addresses to coordinates and vice versa |
| 26 | - Search (Text/Nearby): Find points of interest with contact and hours info |
| 27 | - Autocomplete: Predict addresses based on user input |
| 28 | - Suggest: Predict places and points of interest based on partial or misspelled user input |
| 29 | - Get Place: Retrieve place details by place ID |
| 30 | |
| 31 | **Maps** (SDK: geo-maps, JS: @aws-sdk/client-geo-maps) |
| 32 | |
| 33 | - Dynamic Maps: Interactive maps using tiles with [MapLibre](https://maplibre.org/) rendering |
| 34 | - Static Maps: Pre-rendered, non-interactive map images, good for including an image into a web page, or for thumbnail images |
| 35 | |
| 36 | **Routes** (SDK: geo-routes, JS: @aws-sdk/client-geo-routes) |
| 37 | |
| 38 | - Route calculation with traffic and distance estimation |
| 39 | - Service area/isoline creation |
| 40 | - Matrix calculations for multiple origins/destinations |
| 41 | - GPS trace alignment to road segments |
| 42 | - Route optimization (traveling salesman problem) |
| 43 | |
| 44 | **Geofences & Trackers** (SDK: location, JS: @aws-sdk/client-location) |
| 45 | |
| 46 | - Geofences: Detect entry/exit from geographical boundaries |
| 47 | - Trackers: Current and historical device location tracking |
| 48 | |
| 49 | **API Keys** (SDK: location, JS: @aws-sdk/client-location) |
| 50 | |
| 51 | - API Keys: Grant access to public applications without exposing AWS credentials |
| 52 | |
| 53 | ## Common Mistakes |
| 54 | |
| 55 | Avoid these frequent errors: |
| 56 | |
| 57 | 1. **Using `Title` instead of `Address.Label` for display**: In Autocomplete results, always display `Address.Label`. The `Title` field may show components in reverse order and is not suitable for user-facing text. |
| 58 | |
| 59 | 2. **Using GetStyleDescriptor API for map initialization**: MUST use direct URL passing to MapLibre (`https://maps.geo.{region}.amazonaws.com/v2/styles/Standard/descriptor?key={apiKey}`) instead of making GetStyleDescriptor API calls. The direct URL method is required for proper map rendering. |
| 60 | |
| 61 | 3. **Forgetting `validateStyle: false` in MapLibre config**: Always set `validateStyle: false` in the MapLibre Map constructor for faster map load times with Amazon Location styles. |
| 62 | |
| 63 | 4. **Mixing resource-based and resourceless operations**: When possible, prefer resourceless operations (direct API calls without pre-created resources) for simpler deployment and permissions. |
| 64 | |
| 65 | 5. **Inconsistent API operation naming**: Use the format `service:Operation` when referencing APIs (e.g., `geo-places:Geocode`, `geo-maps:GetStyleDescriptor`). SDK clients use `@aws-sdk/client-*` format. |
| 66 | |
| 67 | 6. **Not handling nested Address objects correctly**: The Address object from GetPlace contains nested objects (`Region.Code`, `Region.Name`, `Country.Code2`, etc.), not flat strings. Access nested properties correctly. |
| 68 | |
| 69 | 7. **Wrong action names in API Key permissions**: API key `AllowActions` use `geo-maps:`, `geo-places:`, `geo-routes:` prefixes (e.g., `geo-places:Geocode`, `geo-routes:CalculateRoutes`). Do NOT use SDK client names (`@aws-sdk/client-geo-places`) or IAM-style actions. See the Authentication and Permissions section for the complete list. |
| 70 | |
| 71 | ## Defaults |
| 72 | |
| 73 | Use these default choices unless the user explicitly requests otherwise: |
| 74 | |
| 75 | - **JavaScript SDK**: Bundled client (CDN) for browser-only apps; npm modular SDKs (@aws-sdk/client-geo-\*) for React and build tool apps |
| 76 | - **API operations**: Resourceless for Maps/Places/Routes (Geofencing/Tracking always require pre-created resources) |
| 77 | - **Authentication**: API Key for Maps/Places/Routes; Cognito for Ge |