Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lgl
SmartVillages2
Commits
1cec716b
Commit
1cec716b
authored
1 month ago
by
Matthias Betz
Browse files
Options
Download
Email Patches
Plain Diff
convert saving position to wgs84
parent
645ee737
dev
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/index.js
+8
-3
src/index.js
with
8 additions
and
3 deletions
+8
-3
src/index.js
+
8
-
3
View file @
1cec716b
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
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets