Skip to content

Commit

Permalink
show lat,long, elevation in location label in geopanel
Browse files Browse the repository at this point in the history
If no location then "Click to set location"
  • Loading branch information
Algorush committed Jun 3, 2024
1 parent 953cac8 commit 663eed2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/editor/components/components/GeoPanel/GeoPanel.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className={styles.geo}>
<img src={GeoImg} onClick={onClick} alt="geo" />
<p>San Francisco, California at Market and Van Ness Streets</p>
{coordinateInfo ? (
<p>{coordinateInfo}</p>
) : (
<a onClick={onClick}>Click to set location</a>
)}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
cursor: pointer;
}

& > p {
& > p, & > a {
margin-top: 8px;
font-size: 16px !important;
max-width: 80vw;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
& > a {
filter: brightness(90%);
}
& > a:hover {
filter: brightness(100%);
}
}

0 comments on commit 663eed2

Please sign in to comment.