Commit 14ca916
authored
feat: add WMS GetFeatureInfo identify support (#97)
* feat: add WMS GetFeatureInfo identify support
Enable the identify tool for WMS layers by issuing GetFeatureInfo
requests and rendering the response in the identify popup. JSON, HTML,
and plain-text info formats are supported, with a dev-server proxy to
avoid cross-origin issues.
* Address review feedback
- Compute WMS GetFeatureInfo X/Y from a small query box centered on the
click lng/lat so identify works in rotated/pitched views
- Remove the unreachable {bbox-epsg-3857} bypass in WMS query encoding
- Limit isWmsLayer to layer.type === "wms" to match LayerPanel's canIdentify
- Read layer.source.version and switch SRS/CRS for WMS 1.1.1 vs 1.3.0
- Set FEATURE_COUNT=1 since only the first feature is displayed
- Honor a configured layer.source.infoFormat to avoid extra round-trips
- Require a URL/sourcePath before enabling identify for WMS layers
- Treat DOMException AbortError as an abort in isAbortError
- Document the dev-only WMS proxy / production CORS limitation
* Address Claude review feedback
- Guard the WMS identify .catch() with abortController.signal.aborted so a
superseded request can no longer null the active controller or overwrite
the current popup
- Treat an empty GeoJSON features array as a successful "no hit" instead of
a parse failure, avoiding extra format-probe requests
- Bail out of WMS response parsing when the signal aborts after the body read
- Parse the WMS endpoint via URL so control params override pre-existing
duplicates and land before any fragment
- Mirror stringSource trimming in LayerPanel canIdentify so blank WMS URLs
no longer enable identify
* Address Claude review feedback
- Require a non-blank source.layers (not just a URL) before enabling WMS
identify, so a layer missing LAYERS no longer shows an enabled button
- Sniff bare JSON arrays in addition to objects when content-type is missing
- Keep probing remaining info formats when a body arrives in an unexpected
format instead of returning the mismatched text early
- Make WMS FEATURE_COUNT configurable via source.featureCount (default 1)1 parent 7a408be commit 14ca916
2 files changed
Lines changed: 350 additions & 18 deletions
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
224 | 232 | | |
225 | 233 | | |
226 | 234 | | |
| |||
363 | 371 | | |
364 | 372 | | |
365 | 373 | | |
366 | | - | |
| 374 | + | |
367 | 375 | | |
368 | 376 | | |
369 | 377 | | |
370 | 378 | | |
371 | 379 | | |
372 | 380 | | |
373 | | - | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | 384 | | |
| |||
0 commit comments