maplibre-gl-geoagent 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +32 -0
  2. package/dist/{GeoAgentControl-DOAYVbPg.js → GeoAgentControl-C0NqjEWe.js} +2985 -56
  3. package/dist/GeoAgentControl-C0NqjEWe.js.map +1 -0
  4. package/dist/{GeoAgentControl-DzBY1NXW.cjs → GeoAgentControl-Dpr36122.cjs} +2983 -54
  5. package/dist/GeoAgentControl-Dpr36122.cjs.map +1 -0
  6. package/dist/{anthropic-DhbSHleV.js → anthropic-B3q8CswR.js} +2 -2
  7. package/dist/{anthropic-DhbSHleV.js.map → anthropic-B3q8CswR.js.map} +1 -1
  8. package/dist/{anthropic-C31X7JK8.cjs → anthropic-BkJWRsGY.cjs} +2 -2
  9. package/dist/{anthropic-C31X7JK8.cjs.map → anthropic-BkJWRsGY.cjs.map} +1 -1
  10. package/dist/browser-6nQo2Odo.js +28033 -0
  11. package/dist/browser-6nQo2Odo.js.map +1 -0
  12. package/dist/browser-D6gmHQqD.cjs +28032 -0
  13. package/dist/browser-D6gmHQqD.cjs.map +1 -0
  14. package/dist/{index-C0CcPtSz.cjs → index-B51VnjHA.cjs} +2 -2
  15. package/dist/{index-C0CcPtSz.cjs.map → index-B51VnjHA.cjs.map} +1 -1
  16. package/dist/{index-Bbu2vTKz.js → index-Bi9NrqmL.js} +2 -2
  17. package/dist/{index-Bbu2vTKz.js.map → index-Bi9NrqmL.js.map} +1 -1
  18. package/dist/{index-DXB0TYg3.js → index-CBRcDJl6.js} +2 -2
  19. package/dist/{index-DXB0TYg3.js.map → index-CBRcDJl6.js.map} +1 -1
  20. package/dist/{index-DrL1mot0.cjs → index-CEnhCAzc.cjs} +2 -2
  21. package/dist/{index-DrL1mot0.cjs.map → index-CEnhCAzc.cjs.map} +1 -1
  22. package/dist/{index-1fng-HVi.cjs → index-CbFlyAAM.cjs} +2 -2
  23. package/dist/{index-1fng-HVi.cjs.map → index-CbFlyAAM.cjs.map} +1 -1
  24. package/dist/{index-BU4LZEvR.js → index-DZcJF5D6.js} +2 -2
  25. package/dist/{index-BU4LZEvR.js.map → index-DZcJF5D6.js.map} +1 -1
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.mjs +1 -1
  28. package/dist/maplibre-gl-geoagent.css +79 -0
  29. package/dist/react.cjs +1 -1
  30. package/dist/react.mjs +1 -1
  31. package/dist/types/index.d.ts +1 -0
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/lib/core/GeoAgentControl.d.ts +7 -0
  34. package/dist/types/lib/core/GeoAgentControl.d.ts.map +1 -1
  35. package/dist/types/lib/core/earth-engine.d.ts +181 -0
  36. package/dist/types/lib/core/earth-engine.d.ts.map +1 -0
  37. package/dist/types/lib/core/maplibre-tools.d.ts +37 -1
  38. package/dist/types/lib/core/maplibre-tools.d.ts.map +1 -1
  39. package/dist/types/lib/core/types.d.ts +6 -0
  40. package/dist/types/lib/core/types.d.ts.map +1 -1
  41. package/package.json +2 -1
  42. package/dist/GeoAgentControl-DOAYVbPg.js.map +0 -1
  43. package/dist/GeoAgentControl-DzBY1NXW.cjs.map +0 -1
package/README.md CHANGED
@@ -14,6 +14,7 @@ inspect and operate on the live map through dedicated browser tools.
14
14
  - Collapsible MapLibre control with a floating chat panel
15
15
  - Browser provider UI for OpenAI Responses, OpenAI Chat, Anthropic, Google Gemini, and Amazon Bedrock
16
16
  - Map tools for camera movement, projection, basemaps, markers, GeoJSON, XYZ tiles, layer visibility, opacity, feature queries, screenshots, and layer cleanup
17
+ - Optional Google Earth Engine tools for catalog search, OAuth initialization, dataset tile layers, normalized difference indexes, visualization updates, snippets, and bounded statistics
17
18
  - Optional MapLibre JavaScript execution tool, disabled by default
18
19
  - Destructive layer removal tools gated behind a separate toggle
19
20
  - Copy the visible conversation log as Markdown
@@ -134,6 +135,24 @@ Converse model ID, and set the AWS region. The default Bedrock model is
134
135
  | `allowDestructiveToolsDefault` | `boolean` | `true` |
135
136
  | `showPermissionToggles` | `boolean` | `false` |
136
137
  | `basemaps` | `Record<string, string \| StyleSpecification>` | built-in basemaps |
138
+ | `earthEngine` | `EarthEngineOptions` | `undefined` |
139
+
140
+ ### Earth Engine Options
141
+
142
+ ```typescript
143
+ new GeoAgentControl({
144
+ earthEngine: {
145
+ oauthClientId: "YOUR_GOOGLE_OAUTH_CLIENT_ID",
146
+ projectId: "your-earth-engine-project",
147
+ includeCommunityCatalog: true,
148
+ },
149
+ });
150
+ ```
151
+
152
+ The Earth Engine integration uses browser OAuth through the official
153
+ `@google/earthengine` package. Service account private keys are intentionally
154
+ not supported in this browser-only package. Use a backend proxy if your
155
+ deployment needs service account access.
137
156
 
138
157
  ## Browser Credentials
139
158
 
@@ -168,6 +187,14 @@ Change the basemap to dark, then get the current map state.
168
187
  Add the GeoJSON URL https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json as US counties.
169
188
  ```
170
189
 
190
+ ```text
191
+ Search Google Earth Engine for SRTM elevation datasets, then add the SRTM image with a terrain palette.
192
+ ```
193
+
194
+ ```text
195
+ Load Sentinel-2 surface reflectance for Knoxville in June 2024 and calculate NDVI using B8 and B4.
196
+ ```
197
+
171
198
  ```text
172
199
  Hide the US counties layer, then show it again.
173
200
  ```
@@ -187,8 +214,13 @@ What features are visible at the center of the current map?
187
214
 
188
215
  ```bash
189
216
  npm install
217
+ cp .env.example .env
190
218
  npm run dev
191
219
  npm test
192
220
  npm run build
193
221
  npm run build:examples
194
222
  ```
223
+
224
+ For the Earth Engine example, set `VITE_GEE_OAUTH_CLIENT_ID` in `.env`.
225
+ `VITE_GEE_PROJECT_ID` is optional; when it is omitted, users can enter their
226
+ own Earth Engine-enabled Google Cloud project ID in the GeoAgent panel.