Implement default baselayer option
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
ee4e7113d2
commit
6367d3399d
@ -407,9 +407,13 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
}
|
||||
var selectedBaseLayer: IItemLayer = null;
|
||||
var mapState = tassign(state.mapState);
|
||||
let sb = baseLayers.filter(layer => layer.item.code === mapState.baseLayerCode)[0];
|
||||
if (baseLayers.length > 0 && mapState.baseLayerCode != "" && sb) {
|
||||
selectedBaseLayer = sb;
|
||||
let sb = baseLayers.filter(layer => layer.item.code === mapState.baseLayerCode);
|
||||
let db = baseLayers.filter(layer => layer.item.data && layer.item.data.default === true);
|
||||
if (baseLayers.length > 0 && mapState.baseLayerCode != "" && sb.length>0) {
|
||||
selectedBaseLayer = sb[0];
|
||||
selectedBaseLayer.visible = true;
|
||||
} else if (baseLayers.length >0 && db.length>0){
|
||||
selectedBaseLayer = db[0];
|
||||
selectedBaseLayer.visible = true;
|
||||
} else if (baseLayers.length > 0) {
|
||||
selectedBaseLayer = baseLayers[0];
|
||||
|
Loading…
Reference in New Issue
Block a user