mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Import GeoJSON, KML, KMZ and GPX files on Navara: shapes as clamped vector layers, pins as sprites, and the graphics it cannot draw counted and reported
This commit is contained in:
1 parent
eee4f48745
commit
d8c63c69d8
22 files changed
+1368
-68
No files matched your search
+28
-4
@@ -3,7 +3,7 @@
|
||||
// with src/app/navaraMode.js, so the Cesium-mode bundle carries none of it.
|
||||
|
||||
import { createNavaraAnnotationRenderer } from '../annotations/navaraAnnotationRenderer.js';
|
||||
import { sessionAnnotations } from './sessionTools.js';
|
||||
import { sessionAnnotations, sessionGeoImport } from './sessionTools.js';
|
||||
|
||||
/**
|
||||
* The annotation board drawn on this Navara scene: draped areas and routes
|
||||
@@ -38,7 +38,31 @@ export function attachNavaraDraw() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** UTILITIES ▸ Import on this Navara scene; null while it has none. */
|
||||
export function attachNavaraGeoImport() {
|
||||
return null;
|
||||
/**
|
||||
* UTILITIES ▸ Import on this Navara scene: the session's files drawn by
|
||||
* `drawImported(engine, dataSource)` (src/layers/shared/render/navaraStory.js,
|
||||
* loaded by src/app/navaraMode.js), what Navara leaves out of them reported
|
||||
* in the control's hint; drops and camera gestures on this engine's canvas.
|
||||
* Returns the control (null on a page without it or without the view).
|
||||
*/
|
||||
export function attachNavaraGeoImport(
|
||||
{ engine, views, mapStackController },
|
||||
{ layerSession, styleManager, operations, drawImported },
|
||||
{ defer },
|
||||
) {
|
||||
if (!views?.view || typeof drawImported !== 'function') return null;
|
||||
const geoFileImport = sessionGeoImport({
|
||||
layerSession,
|
||||
styleManager,
|
||||
operations,
|
||||
defer,
|
||||
});
|
||||
geoFileImport?.attachScene({
|
||||
engine,
|
||||
draw: (dataSource) => drawImported(engine, dataSource),
|
||||
navigation: styleManager,
|
||||
subscribeMapSource: (listener) => mapStackController?.subscribe?.(listener),
|
||||
});
|
||||
defer(() => geoFileImport?.detachScene());
|
||||
return geoFileImport;
|
||||
}
|
||||
Reference in new issue
Block a user