Skip to content

Commit

Permalink
Add support for thematicDataSource in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Son-HNguyen committed Oct 29, 2019
1 parent e84e296 commit 85afb36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 3dwebclient/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ function saveLayerSettings() {
applySaving('maxSizeOfCachedTiles', activeLayer);
applySaving('maxCountOfVisibleTiles', activeLayer);
console.log(activeLayer);
var test = activeLayer["thematicDataSource"];

// update GUI:
var nodes = document.getElementById('citydb_layerlistpanel').childNodes;
Expand Down Expand Up @@ -534,6 +535,8 @@ function loadLayerGroup(_layers) {

// show/hide glTF version based on the value of Layer Data Type
layerDataTypeDropdownOnchange();

thematicDataSourceDropdownOnchange();
}
}).otherwise(function (error) {
CitydbUtil.showAlertWindow("OK", "Error", error.message);
Expand Down Expand Up @@ -1297,11 +1300,13 @@ function layerDataTypeDropdownOnchange() {
} else {
document.getElementById("gltfVersionDropdownRow").style.display = "";
}
addLayerViewModel["layerDataType"] = layerDataTypeDropdown.options[layerDataTypeDropdown.selectedIndex].value;
}

function thematicDataSourceDropdownOnchange() {
var thematicDataSourceDropdown = document.getElementById("thematicDataSourceDropdown");
var selectedThematicDataSource = thematicDataSourceDropdown.options[thematicDataSourceDropdown.selectedIndex].value;
addLayerViewModel["thematicDataSource"] = selectedThematicDataSource;

// if (selectedThematicDataSource == "GoogleSheets") {
// document.getElementById("rowGoogleSheetsApiKey").style.display = "table-row";
Expand Down
11 changes: 11 additions & 0 deletions js/CitydbKmlLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
// extended variables for CitydbKmlLayer
this._cesiumViewer = undefined;
this._thematicDataUrl = Cesium.defaultValue(options.thematicDataUrl, "");
this._thematicDataSource = Cesium.defaultValue(options.thematicDataSource, "");
this._thematicDataProvider = Cesium.defaultValue(options.thematicDataProvider, "");
this._cityobjectsJsonUrl = options.cityobjectsJsonUrl;
this._cityobjectsJsonData = new Object();
Expand Down Expand Up @@ -79,6 +80,7 @@
"layerDataType": this.layerDataType,
"gltfVersion": this.gltfVersion,
"thematicDataUrl": this.thematicDataUrl,
"thematicDataSource": this.thematicDataSource,
"thematicDataProvider": this._thematicDataProvider,
"cityobjectsJsonUrl": this.cityobjectsJsonUrl,
"minLodPixels": this.minLodPixels,
Expand Down Expand Up @@ -173,6 +175,15 @@
}
},

thematicDataSource: {
get: function () {
return this._thematicDataSource;
},
set: function (value) {
this._thematicDataSource = value;
}
},

thematicDataProvider: {
get: function () {
return this._thematicDataProvider;
Expand Down

0 comments on commit 85afb36

Please sign in to comment.