Dear community, does anybody know a solution for the following?:
The map starts with a zoom level of a scale of 50.000.
I would like that after zoomIn via mousewheel
the scale is 25.000, and after next zoomin 10000 and safter the next zoomin: 5000.
Has anybody an idea?
Solved! Go to Solution.
Allright, I got it:
The constraint snapToZoom should be false;
const view = new MapView({ container: "viewDiv", map: map, zoom: 3, center: new Point({ x: 413036, y: 5791444, spatialReference : 25832 }), highlightOptions: { color: [192, 55, 44, 1], width: 2, fillOpacity: 0 }, constraints: { rotationEnabled: false , snapToZoom: false } });
And afterwards:
reactiveUtils.watch( () => [view.stationary, view.scale], ([stationary, scale]) => { if (stationary) { alert ("hello"+view.zoom); if (view.zoom==5){ view.scale=3000; }
Allright, I got it:
The constraint snapToZoom should be false;
const view = new MapView({ container: "viewDiv", map: map, zoom: 3, center: new Point({ x: 413036, y: 5791444, spatialReference : 25832 }), highlightOptions: { color: [192, 55, 44, 1], width: 2, fillOpacity: 0 }, constraints: { rotationEnabled: false , snapToZoom: false } });
And afterwards:
reactiveUtils.watch( () => [view.stationary, view.scale], ([stationary, scale]) => { if (stationary) { alert ("hello"+view.zoom); if (view.zoom==5){ view.scale=3000; }