Skip to content

Commit

Permalink
fix: Tiled wind/mesh layers does not work when coming from another ba…
Browse files Browse the repository at this point in the history
…ckend (closes #1015)
  • Loading branch information
claustres committed Dec 12, 2024
1 parent a7cffe8 commit d9f6e6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions map/client/mixins/map/mixin.tiled-mesh-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ export const tiledMeshLayers = {
const colorMap = _.get(options, 'variables[0].chromajs', null)
if (colorMap) Object.assign(layerOptions, { chromajs: colorMap })

const apiToken = await this.$api.get('storage').getItem(this.$config('gatewayJwt'))

// Build grid source
const [gridKey, gridConf] = extractGridSourceConfig(options)
const weacastApi = (typeof options.getPlanetApi === 'function' ? options.getPlanetApi() : this.getWeacastApi())
const apiToken = (weacastApi.hasConfig('gatewayJwt') ? await weacastApi.get('storage').getItem(weacastApi.getConfig('gatewayJwt')) : null)
const gridSource = makeGridSource(gridKey, { weacastApi, apiToken })
gridSource.setup(gridConf)
if (gridSource.updateCtx) {
Expand Down
2 changes: 1 addition & 1 deletion map/client/mixins/map/mixin.tiled-wind-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const tiledWindLayers = {
vSource.setup(gridConf)
if (uSource.updateCtx) {
// define variables for source's dynamic properties
const gatewayToken = await this.$api.get('storage').getItem(this.$config('gatewayJwt'))
const gatewayToken = (weacastApi.hasConfig('gatewayJwt') ? await weacastApi.get('storage').getItem(weacastApi.getConfig('gatewayJwt')) : null)
if (gatewayToken) {
uSource.updateCtx.jwtToken = gatewayToken
vSource.updateCtx.jwtToken = gatewayToken
Expand Down

0 comments on commit d9f6e6c

Please sign in to comment.