Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alfakhori
Gengenbach
Commits
af3bbe7d
Commit
af3bbe7d
authored
Oct 05, 2026
by
Alfakhori
Browse files
return to 126
parent
ae2a0557
Pipeline
#12486
passed with stage
in 26 seconds
Changes
5
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
public/ar_download.js
View file @
af3bbe7d
function
downloadScene
()
{
const
placedModels
=
window
.
getAllPlacedModels
().
map
((
model
)
=>
{
const
{
lat
,
lng
}
=
window
.
threeToLeaflet
(
model
.
position
.
x
,
model
.
position
.
z
,
);
const
placedModels
=
getAllPlacedModels
().
map
(
model
=>
{
const
{
lat
,
lng
}
=
threeToLeaflet
(
model
.
position
.
x
,
model
.
position
.
z
);
return
{
name
:
model
.
modelConfig
.
name
,
position
:
model
.
position
,
...
...
@@ -11,10 +8,10 @@ function downloadScene() {
scale
:
model
.
scale
,
lat
:
lat
,
lng
:
lng
,
}
;
}
});
console
.
log
(
"
Modelle:
"
+
placedModels
.
length
)
;
console
.
log
(
"
Modelle:
"
+
placedModels
.
length
)
if
(
placedModels
.
length
===
0
)
{
showInfoDialog
(
"
Szene ist leer
"
);
return
;
...
...
@@ -30,7 +27,7 @@ function downloadScene() {
lat
:
geoLocation
.
latitude
,
lng
:
geoLocation
.
longitude
,
models
:
placedModels
,
}
;
}
const
sceneData
=
JSON
.
stringify
(
data
,
null
,
1
);
const
blob
=
new
Blob
([
sceneData
],
{
type
:
"
application/json
"
});
...
...
@@ -48,20 +45,20 @@ function downloadScene() {
}
function
loadSceneFromFile
(
loadedData
)
{
const
fileInput
=
document
.
createElement
(
"
input
"
);
fileInput
.
type
=
"
file
"
;
fileInput
.
accept
=
"
application/json
"
;
const
fileInput
=
document
.
createElement
(
'
input
'
);
fileInput
.
type
=
'
file
'
;
fileInput
.
accept
=
'
application/json
'
;
fileInput
.
addEventListener
(
"
change
"
,
function
(
event
)
{
fileInput
.
addEventListener
(
'
change
'
,
function
(
event
)
{
const
file
=
event
.
target
.
files
[
0
];
const
fileName
=
file
?
file
.
name
:
"
Keine Datei ausgewählt
"
;
const
fileName
=
file
?
file
.
name
:
"
Keine Datei ausgewählt
"
if
(
!
file
)
{
console
.
log
(
"
Keine Datei ausgewählt
"
);
return
;
}
const
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
reader
.
onload
=
function
(
e
)
{
try
{
const
sceneData
=
JSON
.
parse
(
e
.
target
.
result
);
loadedData
(
sceneData
,
fileName
);
...
...
@@ -74,7 +71,3 @@ function loadSceneFromFile(loadedData) {
});
fileInput
.
click
();
}
\ No newline at end of file
/* Expose functions used by the existing HTML and ar_start.js. */
window
.
downloadScene
=
downloadScene
;
window
.
loadSceneFromFile
=
loadSceneFromFile
;
public/ar_main.js
View file @
af3bbe7d
This diff is collapsed.
Click to expand it.
public/ar_overviewmap.js
View file @
af3bbe7d
import
*
as
THREE
from
"
three
"
;
let
init
=
false
;
let
mymap
;
let
userIcon
;
...
...
@@ -100,7 +98,7 @@ function init_map() {
// Add currently placed models to map
// ========================================================
const
models
=
window
.
getAllPlacedModels
();
const
models
=
getAllPlacedModels
();
models
.
forEach
((
model
)
=>
{
const
{
lat
,
lng
}
=
threeToLeaflet
(
model
.
position
.
x
,
model
.
position
.
z
);
...
...
@@ -212,12 +210,7 @@ function updateMap() {
}
// PERFORMANCE: Reuse the same Vector3 object.
const
activeCamera
=
typeof
window
.
getXRRenderCamera
===
"
function
"
?
window
.
getXRRenderCamera
()
:
camera
;
activeCamera
.
getWorldPosition
(
cameraPosition
);
camera
.
getWorldPosition
(
cameraPosition
);
// PERFORMANCE: Do not update Leaflet if the user
// has not moved.
...
...
@@ -330,10 +323,3 @@ function roundTo(n, digits) {
return
parseFloat
(
n
);
}
/* Expose map functions needed by the other application modules. */
window
.
init_map
=
init_map
;
window
.
centerOnPlan
=
centerOnPlan
;
window
.
threeToLeaflet
=
threeToLeaflet
;
window
.
leafletToThree
=
leafletToThree
;
window
.
roundTo
=
roundTo
;
public/ar_start.js
View file @
af3bbe7d
...
...
@@ -79,6 +79,7 @@ function showStartScreen() {
startScreen
.
appendChild
(
hftLogo
);
/* ==========================================================
TITLE
========================================================== */
...
...
@@ -189,7 +190,7 @@ function showStartScreen() {
predefinedButton2
=
null
;
// Start AR
window
.
window
.
activateXR
(
sceneData
);
activateXR
(
sceneData
);
};
/* ==========================================================
...
...
@@ -197,7 +198,7 @@ function showStartScreen() {
========================================================== */
loadButton
.
onclick
=
()
=>
{
window
.
window
.
loadSceneFromFile
((
data
,
fileName
)
=>
{
loadSceneFromFile
((
data
,
fileName
)
=>
{
if
(
data
&&
fileName
)
{
sceneData
=
data
;
sceneFileName
=
fileName
;
...
...
public/index.html
View file @
af3bbe7d
...
...
@@ -9,15 +9,8 @@
<link
rel=
"stylesheet"
href=
"style.css"
>
<!-- Three.js (modern ES module setup) -->
<script
type=
"importmap"
>
{
"
imports
"
:
{
"
three
"
:
"
https://unpkg.com/three@0.186.0/build/three.module.js
"
,
"
three/addons/
"
:
"
https://unpkg.com/three@0.186.0/examples/jsm/
"
}
}
</script>
<script
src=
"https://unpkg.com/three@0.126.0/build/three.js"
></script>
<script
src=
"https://unpkg.com/three@0.126.0/examples/js/loaders/GLTFLoader.js"
></script>
</head>
<body>
...
...
@@ -306,7 +299,7 @@
============================================================ -->
<div
id=
"app-version"
>
v0.1.
4
v0.1.
3
</div>
...
...
@@ -314,14 +307,11 @@
JAVASCRIPT
============================================================ -->
<!-- Debug console loads first so it can capture module errors/logs -->
<script
src=
"ar_debug_console.js"
></script>
<script
src=
"ar_start.js"
></script>
<script
src=
"ar_main.js"
></script>
<!-- Application modules -->
<script
type=
"module"
src=
"ar_main.js"
></script>
<script
type=
"module"
src=
"ar_overviewmap.js"
></script>
<script
type=
"module"
src=
"ar_download.js"
></script>
<script
type=
"module"
src=
"ar_start.js"
></script>
<script
src=
"ar_debug_console.js"
></script>
<link
rel=
"stylesheet"
...
...
@@ -329,7 +319,9 @@
<script
src=
"https://unpkg.com/leaflet/dist/leaflet.js"
></script>
<script
src=
"ar_overviewmap.js"
></script>
<script
src=
"ar_download.js"
></script>
<!-- ============================================================
...
...
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