Skip to content

Commit

Permalink
Access token usage fixed for cesium terrain layers.
Browse files Browse the repository at this point in the history
Wrong access token was used, if terrain providers are defined in app.js,
because token is set inside hscesium.js module, which is used later.
Now the createWorldTerrain function will be called,
 when the layer is turned on and thus the correct token will be used.

fixes #147
  • Loading branch information
raitisbe committed Jan 11, 2019
1 parent bb24247 commit 90941b0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/hscesium/hs_cesium_layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ define(['ol', 'moment', 'proj4'],
setupEvents() {
me.$rootScope.$on('layermanager.base_layer_visible_changed', function(event, data, b) {
if (angular.isDefined(data) && angular.isDefined(data.type) && data.type == 'terrain') {
me.viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url: data.url
});
if(data.url == 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles') {
var terrain_provider = Cesium.createWorldTerrain(me.config.createWorldTerrainOptions);
if (me.config.newTerrainProviderOptions) terrain_provider = new Cesium.CesiumTerrainProvider(me.config.newTerrainProviderOptions);
me.viewer.terrainProvider = terrain_provider;
} else {
me.viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url: data.url
});
}
}
});

Expand Down

0 comments on commit 90941b0

Please sign in to comment.