mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Keep street imagery and picked coverage across Cesium and Navara
This commit is contained in:
1 parent
75df3389f3
commit
b98cbeebf2
20 files changed
+561
-62
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import * as geo from '../../geo/index.js';
|
||||
import { GROUND_CLICK_MAX_HEIGHT_M } from './policy.js';
|
||||
import { cameraHeightAboveGround } from './view.js';
|
||||
import { cameraHeightAboveGround, cameraLocation } from './view.js';
|
||||
|
||||
/** Whether the camera is low enough for a click on the ground to mean a street. */
|
||||
export function groundClickHeightOk(viewer) {
|
||||
if (!viewer?.camera?.positionCartographic) return false;
|
||||
if (!cameraLocation(viewer)) return false;
|
||||
return cameraHeightAboveGround(viewer) <= GROUND_CLICK_MAX_HEIGHT_M;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export function createGroundClick({ state, openNearest, isAvailable }) {
|
||||
)
|
||||
.map((entry) => entry.def.id);
|
||||
if (!providerIds.length) return false;
|
||||
const position = scenePick.pickGroundPosition(state.viewer, screenPosition);
|
||||
const position = state.viewer.engine ? state.viewer.engine.picker.pickGlobe(screenPosition) : scenePick.pickGroundPosition(state.viewer, screenPosition);
|
||||
const carto = position && geo.cartographic.fromCartesian(position);
|
||||
if (!carto) return false;
|
||||
return openNearest(
|
||||
|
||||
Reference in new issue
Block a user