Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Street geo editor #540

Merged
merged 65 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1c5789d
add street-geo component call to layersFunctions
Algorush May 29, 2024
990f4d6
add react-google-maps/api in package.json
Algorush May 29, 2024
534011f
add geoPanel and GeoModal code from 3DStreet-editor/billing
Algorush May 29, 2024
5e34682
add marker and select coordinates on the map
Algorush May 30, 2024
acc2ef5
save coordinate in metadata and set it to street-geo component
Algorush May 30, 2024
8a9d0b0
fix get attribute data
Algorush May 30, 2024
c2876b8
load Layers map cards with coords from metadata
Algorush May 30, 2024
af003ab
fix access control logic
kfarr May 30, 2024
3f7e49f
simplify geo modal access logic
kfarr May 30, 2024
c35fc54
more geo modal simplification
kfarr May 30, 2024
2c30773
dont save reference-layers children in JSON
Algorush May 31, 2024
ad9725f
fix mapbox2d defaults
kfarr May 31, 2024
d2042ad
add pro badge to new entity panel
kfarr May 31, 2024
48fac1f
new defaults for geo modal
kfarr May 31, 2024
f28ac1f
increase webpack maxAssetSize and maxEntrypointSize options to 1.5 MiB
vincentfretin May 31, 2024
fdbfd27
round coord to 7 for 1cm precision
Algorush May 31, 2024
dc63d86
env.FIREBASE_API_KEY
Algorush May 31, 2024
ae5617b
no need for curly braces
Algorush May 31, 2024
a314cd3
Merge branch 'main' into street-geo-editor
kfarr May 31, 2024
97b02e8
use firebaseConfig object export
Algorush May 31, 2024
b0ad54f
Merge branch 'street-geo-editor' of https://github.com/3DStreet/3dstr…
kfarr May 31, 2024
5606338
The current location of the geospatial long/lat display in the geomod…
Algorush Jun 1, 2024
d88c370
Coordinate field handler to allow user to enter coordinates and chang…
Algorush Jun 1, 2024
031e6ea
Merge branch 'street-geo-editor' of https://github.com/3DStreet/3dstr…
Algorush Jun 1, 2024
69b403d
temporary hack to fix elevation for local testing
kfarr Jun 1, 2024
b307903
use existing Save24Icon
kfarr Jun 1, 2024
2be89c5
add Autocomplete for searching location
Algorush Jun 2, 2024
b1aef0d
Merge branch 'street-geo-editor' of https://github.com/3DStreet/3dstr…
Algorush Jun 2, 2024
c828843
add elevation field
Algorush Jun 3, 2024
8ad1cd3
restyle of footer buttons and title
Algorush Jun 3, 2024
953cac8
make help button transparent
Algorush Jun 3, 2024
663eed2
show lat,long, elevation in location label in geopanel
Algorush Jun 3, 2024
690a5db
'New Scene' default title & simplify title editing
kfarr Jun 3, 2024
f7ea8bf
minor changes to geopanel info
kfarr Jun 3, 2024
c5d52ba
working staging server deploy process
kfarr Jun 3, 2024
1514f38
move cross-env to devDependencies
vincentfretin Jun 3, 2024
73fa969
fix lint:fix command to use the same args as lint command to work on …
vincentfretin Jun 3, 2024
5b9dc54
add webxr settings to a-scene
kfarr Jun 3, 2024
b148095
save/load geoData in JSON file
Algorush Jun 4, 2024
695418a
Merge branch 'street-geo-editor' of https://github.com/3DStreet/3dstr…
Algorush Jun 4, 2024
d15bd99
remove the whole dist folder and add it to gitignore
vincentfretin Jun 4, 2024
abee710
get GOOGLE_API_KEY from firebaseConfig.apiKey
Algorush Jun 4, 2024
43d7714
Merge branch 'street-geo-editor' of https://github.com/3DStreet/3dstr…
Algorush Jun 4, 2024
2a04971
don't store geo coords in metadata. Store it in street-geo
Algorush Jun 5, 2024
c9a1a03
new aframe-loader-3dtiles dist
Algorush Jun 5, 2024
c7a79fe
dynamically load aframe-loader-3dtiles-component, update code for it
Algorush Jun 5, 2024
d1cbe64
remove old line to work 3dtiles with editor
Algorush Jun 5, 2024
ff551ce
update three-loader-3dtiles lib version
Algorush Jun 5, 2024
a4afc3a
Add spring objects (#559)
kfarr Jun 5, 2024
f26ec38
update geopanel coords from entity instead of metadata
kfarr Jun 5, 2024
d71a7b5
move search input below map
kfarr Jun 5, 2024
403f97e
prevent scrolling in geomodal
kfarr Jun 5, 2024
79a9a7d
Merge branch 'main' into street-geo-editor
kfarr Jun 5, 2024
43a122c
request elevation from google.maps in requestAndSetElevation function
Algorush Jun 6, 2024
60f40bb
Merge branch 'street-geo-editor' of https://github.com/3DStreet/3dstr…
Algorush Jun 6, 2024
c6283ef
temporary posthog removal
kfarr Jun 6, 2024
d780b7e
only show geopanel if pro user
kfarr Jun 7, 2024
e27b8cd
wHoops
kfarr Jun 7, 2024
165866a
untitled instead of new scene
kfarr Jun 7, 2024
c1b4c26
pro user required for cloud save with long/lat
kfarr Jun 7, 2024
2ffba44
Ar mode (#552)
kfarr Jun 7, 2024
43f77b2
ignore eslint warning for setMarkerPositionAndElevation missing in de…
vincentfretin Jun 7, 2024
f3539d0
add nayuki's qrcodegen.js library
vincentfretin Jun 7, 2024
2ba2375
show QR code and download it in jpg format
vincentfretin Jun 7, 2024
5205ac3
add production deploy project id
kfarr Jun 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ gh-pages/
npm-debug.log*
build/
*.sw[pomn]
# That's /src/lib/aframe-loader-3dtiles-component.min.js
dist/48406973e3ad4d65cbdd.js*
dist/aframe-mapbox-component.min.js
dist/notyf.min.css
dist/viewer-styles.css
dist/
/public/assets
3 changes: 0 additions & 3 deletions dist/aframe-street-component.js

This file was deleted.

297 changes: 151 additions & 146 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,158 +1,163 @@
<!DOCTYPE html>
<html>
<head>
<!-- aframe -->
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>

<!-- 3dstreet -->
<script src="./dist/aframe-street-component.js"></script>

<!-- mapbox -->
<script src="./dist/aframe-mapbox-component.min.js"></script>

<!-- viewer controls - vr teleport -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-blink-controls.min.js"></script>

<script>
// TODO: This should be inside of Viewer Wrapper component logic
// this makes the same camera rig setup work in VR and desktop modes
// this could be a new component, such as "swap desktop and vr controls" and put in init section
window.addEventListener("DOMContentLoaded", function() {
const sceneEl = document.querySelector("a-scene");
sceneEl.addEventListener("enter-vr", function() {
document.querySelector('#cameraRig').removeAttribute('look-controls')
document.querySelector('#cameraRig').removeAttribute('wasd-controls')
document.querySelector('#cameraRig').removeAttribute('cursor-teleport')
document.querySelector('#cameraRig').setAttribute('position', '0 0 0')
});
sceneEl.addEventListener("exit-vr", function() {
document.querySelector('#cameraRig').setAttribute('cursor-teleport', "cameraRig: #cameraRig; cameraHead: #camera;")
document.querySelector('#cameraRig').setAttribute('look-controls', "reverseMouseDrag: true;")
document.querySelector('#cameraRig').setAttribute('wasd-controls', "enabled: true")
});
})
</script>
<title>3DStreet</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="ui_assets/favicon.ico">
<link rel="stylesheet" href="./dist/viewer-styles.css">
</head>

<body>
<!-- loading animation start -->
<div class="loader__wrapper">
<div class="loader">
<div class="entities">
<img src="./ui_assets/loader/entities.svg" alt="entities" />
</div>
<div class="transport">
<div class="wrapper__transport">
<img src="./ui_assets/loader/car.svg" class="car" alt="car" />
<img src="./ui_assets/loader/bus.svg" class="bus" alt="bus" />
<img src="./ui_assets/loader/bike.svg" class="bike" alt="bike" />
</div>
</div>
<div class="road">Loading 3DStreet</div>
</div>
</div>

<!-- viewer ui start -->
<div class="viewer-header-wrapper">
<button class="viewer-logo-start-editor-button" onclick="startEditor()">
<img class="viewer-logo-img" alt="3DStreet Viewer" src="ui_assets/3DStreet-Viewer-Start-Editor.svg">
</button>
</div>

<div class="right-fixed">
<ul class="right-menu">
<li onclick="buttonScreenshotTock()"> <a class="camera" href="#"> <span> Capture image as PNG </span> <img src="ui_assets/camera-icon.svg"> </a></li>
<li onclick="STREET.utils.inputStreetmix()"> <a class="load" href="#"> <span> Load Streetmix URL </span> <img src="ui_assets/streetmix-logo.svg"> </a></li>
<!-- <li onclick="inputJSON()"> <a class="load" href="#"> <span> Load JSON String </span> <img src="assets/ui_assets/upload-icon.svg"> </a></li> -->
<li><a class="load"> <label for="inputfile" style="display: inherit; align-items: center; cursor: pointer"> <input type="file" id="inputfile" style="display:none" accept=".js, .json, .txt"> <span> Load JSON File </span> <img src="ui_assets/upload-icon.svg"></label></a></li>
</ul>
</div>

<a-scene
renderer="colorManagement: true; physicallyCorrectLights: true; anisotropy: 16; logarithmicDepthBuffer: true;"
inspector="url: ./dist/3dstreet-editor.js"
timed-inspector="1"
loading-screen="enabled: false"
notify
metadata
scene-title
reflection
>
<a-assets>
<!-- TODO: Add this to repo documentation -->
<!-- you can specify a custom asset path using below syntax -->

<!-- uncomment the line below to load assets from local github submodule -->
<!-- <street-assets url="./assets/"></street-assets> -->

<!-- you can specify a subset of categories of objects to load using below syntax -->

<!-- uncomment the line below to load all possible asset categories -->
<!-- <street-assets categories="sidewalk-props people people-rigged vehicles vehicles-rigged buildings intersection-props segment-textures segment-colors lane-separator stencils vehicles-transit dividers sky grounds"></street-assets> -->

<!-- a reduced set of assets for non-animated streetmix streets without intersections -->
<!-- <street-assets categories="loud-bicycle sidewalk-props people vehicles vehicles-rigged buildings segment-textures segment-colors lane-separator stencils vehicles-transit dividers sky grounds"></street-assets> -->

</a-assets>

<a-entity id="street-container" data-layer-name="User Layers" data-layer-show-children>
<a-entity id="default-street" street streetmix-loader set-loader-from-hash></a-entity>
</a-entity>
<head>
<!-- aframe -->
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
<script src="https://launchar.app/sdk/v1?key=vDhrPJN2RAYrTKXak3LYKFPnPGKYAzKK&redirect=true"></script>

<a-entity id="reference-layers" data-layer-name="Geospatial Layers" data-layer-show-children></a-entity>
<!-- 3dstreet -->
<script src="./dist/aframe-street-component.js"></script>

<a-entity id="environment" data-layer-name="Environment" street-environment="preset: day;"></a-entity>
<!-- mapbox -->
<script src="./dist/aframe-mapbox-component.min.js"></script>

<a-entity id="cameraRig" data-layer-name="Viewer" cursor-teleport="cameraRig: #cameraRig; cameraHead: #camera;" look-controls="reverseMouseDrag: true" wasd-controls="enabled: true">
<a-entity id="camera" camera="far: 1000" position="0 1.6 0" ></a-entity>
<a-entity id="leftHand" hand-controls="hand: left;" blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera; rotateOnTeleport:false;"></a-entity>
<a-entity id="rightHand" hand-controls="hand: right" blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera; rotateOnTeleport:false;"></a-entity>
<a-entity id="screenshot" class="no-pause" screentock visible="false"></a-entity>
</a-entity>
<!-- viewer controls - vr teleport -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-blink-controls.min.js"></script>

</a-scene>
</body>
<script>
/* loading animation script */
document.addEventListener('DOMContentLoaded', function () {
const scene = document.querySelector('a-scene');
const splash = document.querySelector('.loader__wrapper');
scene.addEventListener('loaded', function (e) {
setTimeout(() => {
splash.style.display = 'none';
}, 1000);
// TODO: This should be inside of Viewer Wrapper component logic
// this makes the same camera rig setup work in VR and desktop modes
// this could be a new component, such as "swap desktop and vr controls" and put in init section
window.addEventListener("DOMContentLoaded", function () {
const sceneEl = document.querySelector("a-scene");
sceneEl.addEventListener("enter-vr", function () {
document.querySelector('#cameraRig').removeAttribute('look-controls')
document.querySelector('#cameraRig').removeAttribute('wasd-controls')
document.querySelector('#cameraRig').removeAttribute('cursor-teleport')
document.querySelector('#cameraRig').setAttribute('position', '0 0 0')
});
});
sceneEl.addEventListener("exit-vr", function () {
document.querySelector('#cameraRig').setAttribute('cursor-teleport', "cameraRig: #cameraRig; cameraHead: #camera;")
document.querySelector('#cameraRig').setAttribute('look-controls', "reverseMouseDrag: true;")
document.querySelector('#cameraRig').setAttribute('wasd-controls', "enabled: true")
});
})
</script>
<script>

document.getElementById('inputfile')
.addEventListener('change', STREET.utils.fileJSON);

function buttonScreenshotTock() {
const screenshotEl = document.getElementById('screenshot');
screenshotEl.play(); // double check playing in case we're in editor mode
screenshotEl.setAttribute('screentock', 'type', 'jpg');
screenshotEl.setAttribute('screentock', 'takeScreenshot', true);
}

function startEditor() {
var sceneEl = document.querySelector('a-scene');
sceneEl.components.inspector.openInspector();
document.querySelector('.viewer-header-wrapper').style.display = 'none';
<title>3DStreet</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="ui_assets/favicon.ico">
<link rel="stylesheet" href="./dist/viewer-styles.css">
</head>

<body>
<!-- loading animation start -->
<div class="loader__wrapper">
<div class="loader">
<div class="entities">
<img src="./ui_assets/loader/entities.svg" alt="entities" />
</div>
<div class="transport">
<div class="wrapper__transport">
<img src="./ui_assets/loader/car.svg" class="car" alt="car" />
<img src="./ui_assets/loader/bus.svg" class="bus" alt="bus" />
<img src="./ui_assets/loader/bike.svg" class="bike" alt="bike" />
</div>
</div>
<div class="road">Loading 3DStreet</div>
</div>
</div>

<!-- viewer ui start -->
<div class="viewer-header-wrapper">
<button class="viewer-logo-start-editor-button" onclick="startEditor()">
<img class="viewer-logo-img" alt="3DStreet Viewer" src="ui_assets/3DStreet-Viewer-Start-Editor.svg">
</button>
</div>

<div class="right-fixed">
<ul class="right-menu">
<li onclick="buttonScreenshotTock()"> <a class="camera" href="#"> <span> Capture image as PNG </span> <img
src="ui_assets/camera-icon.svg"> </a></li>
<li onclick="STREET.utils.inputStreetmix()"> <a class="load" href="#"> <span> Load Streetmix URL </span> <img
src="ui_assets/streetmix-logo.svg"> </a></li>
<!-- <li onclick="inputJSON()"> <a class="load" href="#"> <span> Load JSON String </span> <img src="assets/ui_assets/upload-icon.svg"> </a></li> -->
<li><a class="load"> <label for="inputfile" style="display: inherit; align-items: center; cursor: pointer"> <input
type="file" id="inputfile" style="display:none" accept=".js, .json, .txt"> <span> Load JSON File </span>
<img src="ui_assets/upload-icon.svg"></label></a></li>
</ul>
</div>

<a-scene
renderer="colorManagement: true; physicallyCorrectLights: true; anisotropy: 16; logarithmicDepthBuffer: true;"
inspector="url: ./dist/3dstreet-editor.js" timed-inspector="1" loading-screen="enabled: false" notify metadata
scene-title reflection device-orientation-permission-ui="enabled: false"
webxr="requiredFeatures:hit-test,local-floor;referenceSpaceType:local-floor;" xr-mode-ui="XRMode: ar">
<a-assets>
<!-- TODO: Add this to repo documentation -->
<!-- you can specify a custom asset path using below syntax -->

<!-- uncomment the line below to load assets from local github submodule -->
<!-- <street-assets url="./assets/"></street-assets> -->

<!-- you can specify a subset of categories of objects to load using below syntax -->

<!-- uncomment the line below to load all possible asset categories -->
<!-- <street-assets categories="sidewalk-props people people-rigged vehicles vehicles-rigged buildings intersection-props segment-textures segment-colors lane-separator stencils vehicles-transit dividers sky grounds"></street-assets> -->

<!-- a reduced set of assets for non-animated streetmix streets without intersections -->
<!-- <street-assets categories="loud-bicycle sidewalk-props people vehicles vehicles-rigged buildings segment-textures segment-colors lane-separator stencils vehicles-transit dividers sky grounds"></street-assets> -->

</a-assets>

<a-entity id="street-container" data-layer-name="User Layers" data-layer-show-children>
<a-entity id="default-street" street streetmix-loader set-loader-from-hash></a-entity>
</a-entity>

<a-entity id="reference-layers" data-layer-name="Geospatial Layers" data-layer-show-children></a-entity>

<a-entity id="environment" data-layer-name="Environment" street-environment="preset: day;"></a-entity>

<a-entity id="cameraRig" data-layer-name="Viewer" cursor-teleport="cameraRig: #cameraRig; cameraHead: #camera;"
look-controls="reverseMouseDrag: true" wasd-controls="enabled: true">
<a-entity id="camera" camera="far: 1000" position="0 1.6 0"></a-entity>
<a-entity id="leftHand" hand-controls="hand: left;"
blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera; rotateOnTeleport:false;"></a-entity>
<a-entity id="rightHand" hand-controls="hand: right"
blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera; rotateOnTeleport:false;"></a-entity>
<a-entity id="screenshot" class="no-pause" screentock visible="false"></a-entity>
</a-entity>

</a-scene>
</body>
<script>
/* loading animation script */
document.addEventListener('DOMContentLoaded', function () {
const scene = document.querySelector('a-scene');
const splash = document.querySelector('.loader__wrapper');
scene.addEventListener('loaded', function (e) {
setTimeout(() => {
splash.style.display = 'none';
}, 1000);
});
});
</script>
<script>

document.getElementById('inputfile')
.addEventListener('change', STREET.utils.fileJSON);

function buttonScreenshotTock() {
const screenshotEl = document.getElementById('screenshot');
screenshotEl.play(); // double check playing in case we're in editor mode
screenshotEl.setAttribute('screentock', 'type', 'jpg');
screenshotEl.setAttribute('screentock', 'takeScreenshot', true);
}

function startEditor() {
var sceneEl = document.querySelector('a-scene');
sceneEl.components.inspector.openInspector();
document.querySelector('.viewer-header-wrapper').style.display = 'none';
}

AFRAME.registerComponent('timed-inspector', {
init: function () {
setTimeout(function () {
window.postMessage('INJECT_AFRAME_INSPECTOR');
}, this.data * 1000);
}
});
</script>
<!-- <script src="./dist/3dstreet-editor.js"></script> -->

AFRAME.registerComponent('timed-inspector', {
init: function () {
setTimeout(function () {
window.postMessage('INJECT_AFRAME_INSPECTOR');
}, this.data * 1000);
}
});
</script>
<!-- <script src="./dist/3dstreet-editor.js"></script> -->
</html>
</html>
Loading
Loading