Add Rotate with view option
Use a checkbox to demonstrate the rotateWithView option
This commit is contained in:
@@ -6,6 +6,8 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
|
||||
const rotateWithView = document.getElementById('rotateWithView');
|
||||
|
||||
const overviewMapControl = new OverviewMap({
|
||||
// see in overviewmap-custom.html to see the custom CSS used
|
||||
className: 'ol-overviewmap ol-custom-overviewmap',
|
||||
@@ -22,6 +24,10 @@ const overviewMapControl = new OverviewMap({
|
||||
collapsed: false
|
||||
});
|
||||
|
||||
rotateWithView.addEventListener('change', function() {
|
||||
overviewMapControl.setRotateWithView(this.checked);
|
||||
});
|
||||
|
||||
const map = new Map({
|
||||
controls: defaultControls().extend([
|
||||
overviewMapControl
|
||||
|
||||
Reference in New Issue
Block a user