mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Keep the file import's Cesium loading in its pins module and take the file reader off the Cesium list
src/data/geoFileImport.js now only reads, bounds and sanitizes the imported files (GeoJSON, GPX, KML and KMZ). Loading the parsed file as a Cesium data source, scrubbing its entities, settling its ground pins, the pin billboard collection and the footprint read for Fly-to move into src/data/geoImportPins.js, which stays on the Cesium list as the import's Cesium-bound part. The error, the entity limit, the one-minute deadline and feature-name cleanup both parts use live in the new src/data/geoImportShared.js; the reader re-exports them for its existing importers. Nothing changes for the person importing: the same files load with the same refusals, styles, ground heights, pins and framing.
This commit is contained in:
1 parent
2a9a2d5be8
commit
c49191a87b
9 files changed
+469
-412
No files matched your search
@@ -5705,6 +5705,7 @@ request viewbox and continues searching without that geographic preference.
|
||||
- **Input handling.** Coordinates and GeoJSON geometry types are checked before Cesium allocation. Only short plain names reach GeoJSON property bags; file IDs, custom CRS and styling properties are removed. KML feature/geometry IDs are removed while Style/StyleMap references remain. Local style references are trimmed, incomplete style pairs removed, hidden-folder flags normalized to the import's show control, and unsupported prototype-named elements removed. UTF-16 BOMs and common KML namespace export defects are handled. Empty drawable content is refused. A loader failure or timeout does not hold the next file indefinitely; teardown aborts pending waits.
|
||||
- **References and images.** File-authored remote links/icons/styles, network links, models and screen/photo overlays are removed. Packed KMZ and embedded PNG/JPEG/GIF/WebP/BMP images remain local; decoded dimensions are checked before image decoding against a total 16-megapixel and 8,192-pixel-side budget per file. Blocked IconStyle images fall back to local pins; authored empty icons remain empty. Colored overlays without an Icon survive; overlays with a removed external image are dropped. Metadata, native labels and descriptions are removed, and generated pins share one lossless image URL per canvas.
|
||||
- **Bounds.** File size ≤50 MiB; inflated KMZ ≤120 MiB; ≤20,000 entities (including multipart children and Folder containers); ≤250,000 positions; ≤2,000 normalized style definitions and distinct image links; ≤12 files per session. Exact repeated styles share definitions without changing inheritance or inline overrides. Files of 20–30 MB fit the byte budget, subject to geometry/image limits. Refusals name a reason and batches continue; with multiple failures the hint shows the first reason.
|
||||
- **Code layout.** `src/data/geoFileImport.js` reads, bounds and sanitizes the files and no longer imports or drives Cesium itself; it hands the parsed file to the Cesium-bound part. The Cesium-bound part (loading the parsed file as a Cesium data source, scrubbing and grounding its entities, its pin collection and its footprint for Fly-to) is `src/data/geoImportPins.js`, which stays on the Cesium allow-list; `src/data/geoImportShared.js` holds the error, limits, deadline and feature names both use.
|
||||
- **Lifecycle and keyboard.** `createApplicationTools` wires `initGeoFileImport` with viewer, navigation, ground services and map-source subscription. Destroy aborts pending work, unsubscribes, removes data sources, revokes blob URLs, removes document/canvas listeners and releases `window.__gevGeoImport`. List rebuilds retain keyboard focus; removing a row hands focus to the next row, else the previous row, else Import.
|
||||
- **Validation.** `node scripts/qa-geo-import.mjs` covers all four formats and real painted show/hide. Run `node scripts/qa-geo-import-regressions.mjs` against both dev and preview for XYZ/track heights, failure recovery, namespace/BOM support, portrait framing and panel drops. `node scripts/qa-geo-import-large.mjs [--file /absolute/path/sample.kml] [--expect-local-pins]` checks a 27.6 MB repeated-style file, native style/image equivalence, large-file painted output and frame times. It records the WebGL renderer; software-rendered runs do not establish GPU performance. Unit tests live beside the data/controller/framing modules.
|
||||
|
||||
|
||||
Reference in new issue
Block a user