Skip to content

Commit

Permalink
Add simple exclusive layer group example.
Browse files Browse the repository at this point in the history
  • Loading branch information
paul121 committed Sep 28, 2020
1 parent c643147 commit 06750f5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions examples/layerswitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,36 @@
})
})
]
}),
new ol.layer.Group({
// A layer must have a title to appear in the layerswitcher
title: 'Exclusive overlay',
exclusive: true,
layers: [
new ol.layer.Image({
// A layer must have a title to appear in the layerswitcher
type: 'base',
title: 'Countries',
source: new ol.source.ImageArcGISRest({
ratio: 1,
params: { LAYERS: 'show:0' },
url:
'https://ons-inspire.esriuk.com/arcgis/rest/services/Administrative_Boundaries/Countries_December_2016_Boundaries/MapServer'
})
}),
new ol.layer.Image({
// A layer must have a title to appear in the layerswitcher
type: 'base',
title: 'Wards',
visible: false,
source: new ol.source.ImageArcGISRest({
ratio: 1,
params: { LAYERS: 'show:0' },
url:
'https://ons-inspire.esriuk.com/arcgis/rest/services/Census_Boundaries/Census_Merged_Wards_December_2011_Boundaries/MapServer'
})
}),
]
})
]
})
Expand Down

0 comments on commit 06750f5

Please sign in to comment.