diff --git a/src/components/streetplan-loader.js b/src/components/streetplan-loader.js index 13dad3d37..4d6533667 100644 --- a/src/components/streetplan-loader.js +++ b/src/components/streetplan-loader.js @@ -38,7 +38,7 @@ AFRAME.registerComponent('streetplan-loader', { console.log('therefore setting metadata sceneTitle as streetplanName', streetplanName); } - el.setAttribute('data-layer-name', 'Streetplan • ' + streetplanName); + el.setAttribute('data-layer-name', 'StreetPlan • ' + streetplanName); if (data.showBuildings) { el.setAttribute('street', 'right', streetData.rightBuildingVariant); @@ -52,15 +52,15 @@ AFRAME.registerComponent('streetplan-loader', { update: function (oldData) { // fired at start and at each subsequent change of any schema value // This method may fire a few times when viewing a streetmix street in 3dstreet: // First to find the proper path, once to actually load the street, and then subsequent updates such as street name + const that = this; const data = this.data; const el = this.el; - /* ***** debugging ***** */ - setTimeout(()=> { - this.streetplanResponseParse(exampleJSON); - }, 1000); - - return; + // /* ***** debugging ***** */ + // setTimeout(()=> { + // this.streetplanResponseParse(exampleJSON); + // }, 1000); + // return; // load from URL encoded Streetplan JSON if (data.streetplanEncJSON) { @@ -83,7 +83,7 @@ AFRAME.registerComponent('streetplan-loader', { if (this.status >= 200 && this.status < 400) { // Connection success const streetplanResponseObject = JSON.parse(this.response); - this.streetplanResponseParse(streetplanResponseObject); + that.streetplanResponseParse(streetplanResponseObject); } else { // We reached our target server, but it returned an error console.log('[streetplan-loader]', 'Loading Error: We reached the target server, but it returned an error'); diff --git a/src/json-utils_1.1.js b/src/json-utils_1.1.js index 45fcafb2a..897d06077 100644 --- a/src/json-utils_1.1.js +++ b/src/json-utils_1.1.js @@ -536,16 +536,16 @@ AFRAME.registerComponent('set-loader-from-hash', { 'streetmixStreetURL', streetURL ); - } else if (streetURL.startsWith('streetplanJSON:')) { + } else if (streetURL.includes('streetplan.net')) { // load from Streetplan encoded JSON in URL console.log( '[set-loader-from-hash]', - 'Set streetplan-loader streetplanEncJSON to', + 'Set streetplan-loader streetplanAPIURL to', streetURL ); this.el.setAttribute( 'streetplan-loader', - 'streetplanEncJSON', + 'streetplanAPIURL', streetURL ); } else { diff --git a/streetplan.html b/streetplan.html index 635e5d151..6d0c630ec 100644 --- a/streetplan.html +++ b/streetplan.html @@ -89,7 +89,7 @@ - +