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:
Olivier Guyot
2018-11-14 19:34:53 +01:00
parent 50ae34fcc6
commit 593632daea
4 changed files with 17 additions and 11 deletions

View File

@@ -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',