Skip to content

Commit

Permalink
Merge branch 'main' into fix-title-display
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarr committed Jun 11, 2024
2 parents 56eedbb + ea4fe4d commit 0d838ee
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 21 deletions.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
</button>
</div>

<!-- maps copyright start -->
<div id="map-data-attribution" style="visibility: hidden;">
<div id="map-logo">Map Attribution:</div>
<span id="map-copyright"></span>
</div>

<!-- <div class="right-fixed">
<ul class="right-menu">
<li onclick="buttonScreenshotTock()"> <a class="camera" href="#"> <span> Capture image as PNG </span> <img
Expand Down
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"@babel/eslint-parser": "^7.24.5",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"@storybook/addon-essentials": "^7.6.3",
"@storybook/addon-interactions": "^7.6.3",
"@storybook/addon-links": "^7.6.3",
Expand Down Expand Up @@ -76,7 +75,6 @@
"nyc": "^15.1.0",
"prettier": "^3.1.0",
"pretty": "^2.0.0",
"react-refresh": "^0.14.2",
"resolve-url-loader": "^5.0.0",
"rewire": "^7.0.0",
"sass": "^1.69.5",
Expand Down Expand Up @@ -107,4 +105,4 @@
"eslint"
]
}
}
}
13 changes: 12 additions & 1 deletion src/components/street-geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ AFRAME.registerComponent('street-geo', {
this[mapType + 'Update'].bind(this);
}
},
remove: function () {
document.getElementById('map-data-attribution').style.visibility = 'hidden';
},
update: function (oldData) {
const data = this.data;

Expand All @@ -51,6 +54,10 @@ AFRAME.registerComponent('street-geo', {
// remove element from DOM and from this object
this.el.removeChild(this[mapType]);
this[mapType] = null;
if (mapType === 'google3d') {
document.getElementById('map-data-attribution').style.visibility =
'hidden';
}
}
}
},
Expand Down Expand Up @@ -81,6 +88,7 @@ AFRAME.registerComponent('street-geo', {
mapbox2dElement.setAttribute('data-ignore-raycaster', '');
el.appendChild(mapbox2dElement);
this['mapbox2d'] = mapbox2dElement;
document.getElementById('map-data-attribution').style.visibility = 'hidden';
},
google3dCreate: function () {
const data = this.data;
Expand All @@ -100,12 +108,15 @@ AFRAME.registerComponent('street-geo', {
geoTransform: 'WGS84Cartesian',
maximumSSE: 16,
maximumMem: 400,
cameraEl: '#camera'
cameraEl: '#camera',
copyrightEl: '#map-copyright'
});
google3dElement.classList.add('autocreated');
google3dElement.setAttribute('data-ignore-raycaster', '');
el.appendChild(google3dElement);
self['google3d'] = google3dElement;
document.getElementById('map-data-attribution').style.visibility =
'visible';
};

// check whether the library has been imported. Download if not
Expand Down
11 changes: 5 additions & 6 deletions src/editor/components/scenegraph/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
isSceneAuthor,
checkIfImagePathIsEmpty
} from '../../api/scene';
import { Cloud24Icon, RemixIcon, Save24Icon, Upload24Icon } from '../../icons';
import { Cloud24Icon, Save24Icon, Upload24Icon } from '../../icons';
import Events from '../../lib/Events';
import { saveBlob } from '../../lib/utils';
import { Button, ProfileButton, ScreenshotButton } from '../components';
Expand Down Expand Up @@ -368,13 +368,12 @@ export default class Toolbar extends Component {
return (
<div id="toolbar">
<div className="toolbarActions">
{this.state.showSaveBtn &&
!!this.props.isAuthor &&
this.props.currentUser ? (
{this.state.showSaveBtn && this.props.currentUser ? (
<div className="saveButtonWrapper" ref={this.saveButtonRef}>
<Button
className={'actionBtn'}
onClick={this.toggleSaveActionState.bind(this)}
disabled={!this.props.isAuthor}
>
<div
className="iconContainer"
Expand Down Expand Up @@ -437,9 +436,9 @@ export default class Toolbar extends Component {
margin: '-2.5px 0px -2.5px -2px'
}}
>
<RemixIcon />
<Save24Icon />
</div>
<div className={'innerText'}>Remix</div>
<div className={'innerText'}>Save</div>
</Button>
)}
{this.state.showLoadBtn && (
Expand Down
26 changes: 26 additions & 0 deletions src/viewer-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,32 @@ body {
margin: 0;
}

/* maps copyright notice */
#map-data-attribution {
position: absolute;
bottom: 0;
left: 0;
font-size: 10px;
background-color: rgba(0, 0, 0, 0.3);
color: #bebebe;
z-index: 1;
}

#map-logo {
display: inline;
font-style: normal;
font-size: 10px;
line-height: 10px;
color: #bebebe;
}

#map-copyright {
display: inline-block;
line-height: 10px;
color: #bebebe;

}

/* notification hack */
.notyf__message {
font-size: 20px !important;
Expand Down
9 changes: 1 addition & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const webpack = require('webpack');
const path = require('path');
const Dotenv = require('dotenv-webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');

module.exports = {
mode: 'development',
Expand All @@ -23,8 +22,6 @@ module.exports = {
import: ['./src/editor/index.js'],
filename: '3dstreet-editor.js'
},
// react-refresh doesn't work with multiple entry points so we use the production build of aframe-street-component.js in development,
// you will need to run `npm run dist` to see your changes or uncomment temporarily the following line and run `npm start` again.
core: { import: './src/index.js', filename: 'aframe-street-component.js' }
},
output: {
Expand All @@ -37,7 +34,6 @@ module.exports = {
three: 'THREE'
},
plugins: [
new ReactRefreshWebpackPlugin(),
new Dotenv({
path: './config/.env.development'
}),
Expand All @@ -58,10 +54,7 @@ module.exports = {
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: ['react-refresh/babel']
}
loader: 'babel-loader'
}
},
{
Expand Down
7 changes: 6 additions & 1 deletion webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ module.exports = {
}),
new CopyWebpackPlugin({
patterns: [
{ from: 'src/lib/aframe-mapbox-component.min.js' },
{
from: 'src/lib/aframe-mapbox-component.min.js',
info: {
minimized: true
}
},
{ from: 'src/notyf.min.css' },
{ from: 'src/viewer-styles.css' }
]
Expand Down

0 comments on commit 0d838ee

Please sign in to comment.