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';
|
import OSM from '../src/ol/source/OSM.js';
|
||||||
|
|
||||||
|
|
||||||
|
const rotateWithView = document.getElementById('rotateWithView');
|
||||||
|
|
||||||
const overviewMapControl = new OverviewMap({
|
const overviewMapControl = new OverviewMap({
|
||||||
// see in overviewmap-custom.html to see the custom CSS used
|
// see in overviewmap-custom.html to see the custom CSS used
|
||||||
className: 'ol-overviewmap ol-custom-overviewmap',
|
className: 'ol-overviewmap ol-custom-overviewmap',
|
||||||
@@ -22,6 +24,10 @@ const overviewMapControl = new OverviewMap({
|
|||||||
collapsed: false
|
collapsed: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
rotateWithView.addEventListener('change', function() {
|
||||||
|
overviewMapControl.setRotateWithView(this.checked);
|
||||||
|
});
|
||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
controls: defaultControls().extend([
|
controls: defaultControls().extend([
|
||||||
overviewMapControl
|
overviewMapControl
|
||||||
|
|||||||
Reference in New Issue
Block a user