Commit 1cec716b authored by Matthias Betz's avatar Matthias Betz
Browse files

convert saving position to wgs84

parent 645ee737
No related merge requests found
Showing with 8 additions and 3 deletions
+8 -3
import { ToolboxType, WindowSlot, NotificationType } from '@vcmap/ui';
import { Cesium3DTileStyle, Math as CMath, Cartesian3, ConstantProperty, Transforms, HeadingPitchRoll, Cesium3DTileset, Matrix4 } from '@vcmap-cesium/engine';
import { Cesium3DTileStyle, Math as CMath, Ellipsoid, Cartesian3, ConstantProperty, Transforms, HeadingPitchRoll, Cesium3DTileset, Matrix4 } from '@vcmap-cesium/engine';
import { AbstractInteraction, EventType } from '@vcmap/core';
import { name, version, mapVersion } from '../package.json';
import BIMOptions, { bimOptionsId } from './upload.vue';
......@@ -90,9 +90,13 @@ function saveObjects() {
if (tempRoll !== undefined) {
heading = tempRoll.heading;
}
const ellipPos = Ellipsoid.WGS84.cartesianToCartographic(m.model.position.getValue());
const wgs84X = CMath.toDegrees(ellipPos.longitude);
const wgs84Y = CMath.toDegrees(ellipPos.latitude);
const height = ellipPos.height;
outputArray.push({
name: m.name,
position: m.model.position.getValue(),
position: [wgs84X, wgs84Y, height],
heading: heading,
scale: m.model.model.scale.getValue(),
});
......@@ -314,10 +318,11 @@ export default function smartVillagesPlugin(config, baseUrl) {
// abort
return;
}
const cartPos = Cartesian3.fromDegrees(loadingObject.position[0], loadingObject.position[1], loadingObject.position[2]);
// Add the model to the viewer
model = vcMap.getEntities().add({
name: loadingObject.name,
position: loadingObject.position,
position: cartPos,
model: {
uri: objectUrl,
scale: loadingObject.scale,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment