Skip to content

Commit

Permalink
Merge pull request #904 from 3DStreet/osm-perf-update
Browse files Browse the repository at this point in the history
None map type & OSM performance improvements
  • Loading branch information
kfarr authored Oct 29, 2024
2 parents 636ea52 + 2999ca0 commit f39826c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/components/street-geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AFRAME.registerComponent('street-geo', {
maps: {
type: 'string',
default: 'google3d',
oneOf: ['google3d', 'mapbox2d', 'osm3d']
oneOf: ['google3d', 'mapbox2d', 'osm3d', 'none']
},
enableClipping: { type: 'boolean', default: false }
},
Expand Down Expand Up @@ -51,9 +51,9 @@ AFRAME.registerComponent('street-geo', {
if (data.maps === mapType && !this[mapType]) {
// create Map element and save a link to it in this[mapType]
if (!this.isAR) {
this[mapType + 'Create']();
document.getElementById('map-data-attribution').style.visibility =
'visible';
this[mapType + 'Create']();
}
} else if (
data.maps === mapType &&
Expand Down Expand Up @@ -83,6 +83,10 @@ AFRAME.registerComponent('street-geo', {
}
}
},
noneCreate: function () {
// do nothing
document.getElementById('map-data-attribution').style.visibility = 'hidden';
},
mapbox2dCreate: function () {
const data = this.data;
const el = this.el;
Expand Down Expand Up @@ -173,6 +177,10 @@ AFRAME.registerComponent('street-geo', {
);
}
},
noneUpdate: function () {
// do nothing
document.getElementById('map-data-attribution').style.visibility = 'hidden';
},
google3dUpdate: function () {
const data = this.data;
// if data.ellipsoidalHeight, use it, otherwise use data.elevation less constant (deprecated)
Expand Down Expand Up @@ -220,7 +228,7 @@ AFRAME.registerComponent('street-geo', {
osm3dBuildingElement.setAttribute('osm-geojson', {
lon: data.longitude,
lat: data.latitude,
radius_m: 500,
radius_m: 1000,
trackId: 'camera'
});
osm3dBuildingElement.setAttribute('rotation', '0 -90 0');
Expand Down
Loading

0 comments on commit f39826c

Please sign in to comment.