Fix the OverviewMap control & example
Layers must now always be specified for the control. Base example was amended to reflect that. The breaking change was added in the update notes.
This commit is contained in:
@@ -4,13 +4,22 @@ import {defaults as defaultControls, OverviewMap} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
const source = new OSM();
|
||||
const overviewMapControl = new OverviewMap({
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: source
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
const map = new Map({
|
||||
controls: defaultControls().extend([
|
||||
new OverviewMap()
|
||||
overviewMapControl
|
||||
]),
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
source: source
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
|
||||
Reference in New Issue
Block a user