Skip to content

Commit

Permalink
Merge pull request #612 from 3DStreet/add-google-maps-copyright-notice
Browse files Browse the repository at this point in the history
Add google maps copyright notice
  • Loading branch information
kfarr authored Jun 11, 2024
2 parents bb2faf5 + 63598d6 commit ea4fe4d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
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
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
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

0 comments on commit ea4fe4d

Please sign in to comment.