From 663eed28e96f6aa8d47fe28ee9a70b4ed18ea918 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Sun, 2 Jun 2024 23:48:11 -0400 Subject: [PATCH] show lat,long, elevation in location label in geopanel If no location then "Click to set location" --- .../components/GeoPanel/GeoPanel.component.jsx | 12 +++++++++++- .../components/GeoPanel/GeoPanel.module.scss | 8 +++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/editor/components/components/GeoPanel/GeoPanel.component.jsx b/src/editor/components/components/GeoPanel/GeoPanel.component.jsx index b3f942503..c7a772b10 100644 --- a/src/editor/components/components/GeoPanel/GeoPanel.component.jsx +++ b/src/editor/components/components/GeoPanel/GeoPanel.component.jsx @@ -10,11 +10,21 @@ import Events from '../../../lib/Events'; */ const GeoPanel = () => { const onClick = () => Events.emit('opengeomodal'); + const metadata = AFRAME.scenes[0].getAttribute('metadata'); + let coordinateInfo; + if (metadata && metadata['coord']) { + const coord = metadata['coord']; + coordinateInfo = `Latitude: ${coord.latitude}, longitude: ${coord.longitude}, elevation: ${coord.elevation}`; + } return (
geo -

San Francisco, California at Market and Van Ness Streets

+ {coordinateInfo ? ( +

{coordinateInfo}

+ ) : ( + Click to set location + )}
); }; diff --git a/src/editor/components/components/GeoPanel/GeoPanel.module.scss b/src/editor/components/components/GeoPanel/GeoPanel.module.scss index 03adc84b0..a3831c9a3 100644 --- a/src/editor/components/components/GeoPanel/GeoPanel.module.scss +++ b/src/editor/components/components/GeoPanel/GeoPanel.module.scss @@ -11,7 +11,7 @@ cursor: pointer; } - & > p { + & > p, & > a { margin-top: 8px; font-size: 16px !important; max-width: 80vw; @@ -19,4 +19,10 @@ overflow: hidden; white-space: nowrap; } + & > a { + filter: brightness(90%); + } + & > a:hover { + filter: brightness(100%); + } }