Skip to content
GitLab
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
Jun 02, 2025
by
Matthias Betz
Browse files
convert saving position to wgs84
parent
645ee737
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/index.js
View file @
1cec716b
import
{
ToolboxType
,
WindowSlot
,
NotificationType
}
from
'
@vcmap/ui
'
;
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
{
AbstractInteraction
,
EventType
}
from
'
@vcmap/core
'
;
import
{
name
,
version
,
mapVersion
}
from
'
../package.json
'
;
import
{
name
,
version
,
mapVersion
}
from
'
../package.json
'
;
import
BIMOptions
,
{
bimOptionsId
}
from
'
./upload.vue
'
;
import
BIMOptions
,
{
bimOptionsId
}
from
'
./upload.vue
'
;
...
@@ -90,9 +90,13 @@ function saveObjects() {
...
@@ -90,9 +90,13 @@ function saveObjects() {
if
(
tempRoll
!==
undefined
)
{
if
(
tempRoll
!==
undefined
)
{
heading
=
tempRoll
.
heading
;
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
({
outputArray
.
push
({
name
:
m
.
name
,
name
:
m
.
name
,
position
:
m
.
model
.
position
.
getValue
()
,
position
:
[
wgs84X
,
wgs84Y
,
height
]
,
heading
:
heading
,
heading
:
heading
,
scale
:
m
.
model
.
model
.
scale
.
getValue
(),
scale
:
m
.
model
.
model
.
scale
.
getValue
(),
});
});
...
@@ -314,10 +318,11 @@ export default function smartVillagesPlugin(config, baseUrl) {
...
@@ -314,10 +318,11 @@ export default function smartVillagesPlugin(config, baseUrl) {
// abort
// abort
return
;
return
;
}
}
const
cartPos
=
Cartesian3
.
fromDegrees
(
loadingObject
.
position
[
0
],
loadingObject
.
position
[
1
],
loadingObject
.
position
[
2
]);
// Add the model to the viewer
// Add the model to the viewer
model
=
vcMap
.
getEntities
().
add
({
model
=
vcMap
.
getEntities
().
add
({
name
:
loadingObject
.
name
,
name
:
loadingObject
.
name
,
position
:
loadingObject
.
position
,
position
:
cartPos
,
model
:
{
model
:
{
uri
:
objectUrl
,
uri
:
objectUrl
,
scale
:
loadingObject
.
scale
,
scale
:
loadingObject
.
scale
,
...
...
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