mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
fix(geo-import): KML icons stay on their points when zoomed out, and turn by heading as before
Cesium's KML loader shrank an icon's hot-spot offset with the icon and turned a heading about the Earth's axis. The drawn pins kept the full offset at globe distance (up to ~14 px off for the Google Earth pushpin) and turned about local north, which differs in a tilted view. They now scale the offset with the icon and turn about the Earth's axis by the heading.
This commit is contained in:
1 parent
7ba15deb5e
commit
91b080a45a
4 files changed
+16
-3
No files matched your search
@@ -127,9 +127,13 @@ export function createImportedDrawing(
|
||||
if (pin.anchor) item.anchor = pin.anchor;
|
||||
if (pin.scaleByDistance) item.scaleByDistance = pin.scaleByDistance;
|
||||
if (pin.pixelOffset) item.pixelOffset = pin.pixelOffset;
|
||||
if (pin.offsetScalesByDistance) item.offsetScalesByDistance = true;
|
||||
if (pin.course !== undefined) {
|
||||
item.rotationMode = 'course';
|
||||
item.course = pin.course;
|
||||
// Turned clockwise by its heading from the Earth's axis as it stands
|
||||
// on screen, as Cesium's KML icons were.
|
||||
item.rotationMode = 'axis';
|
||||
item.alignedAxis = { x: 0, y: 0, z: 1 };
|
||||
item.rotation = (-pin.course * Math.PI) / 180;
|
||||
}
|
||||
// On the ground or above it, drawn over what is in front.
|
||||
if (pin.mode !== 'absolute') item.disableDepthTest = Infinity;
|
||||
|
||||
Reference in new issue
Block a user