Fix base map not showing
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-05-19 11:14:07 +02:00
parent f4d1a04303
commit 51bb5b3833
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@
"@ngrx/router-store": "^9.0",
"@ngrx/store": "^9.0",
"tassign": "^1.0.0",
"@farmmaps/common": ">=0.0.1-prerelease.181 <0.0.1",
"@farmmaps/common": ">=0.0.1-prerelease.265 <0.0.1",
"ngx-openlayers": "1.0.0-next.13",
"ol": "6.1.1"
}

View File

@ -401,9 +401,9 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
}
var selectedBaseLayer: IItemLayer = null;
var mapState = tassign(state.mapState);
console.debug(`Base layerload: ${mapState.baseLayerCode}`)
if (baseLayers.length > 0 && mapState.baseLayerCode != "") {
selectedBaseLayer = baseLayers.filter(layer => layer.item.code === mapState.baseLayerCode)[0];
let sb = baseLayers.filter(layer => layer.item.code === mapState.baseLayerCode)[0];
if (baseLayers.length > 0 && mapState.baseLayerCode != "" && sb) {
selectedBaseLayer = sb;
selectedBaseLayer.visible = true;
} else if (baseLayers.length > 0) {
selectedBaseLayer = baseLayers[0];