Select to view content in your preferred language

Mouse wheel zoom too quick with map view and scene view

232
5
02-06-2025 02:34 PM
TedZhou
Occasional Contributor

Our customers complain the mouse wheel to zoom in and zoom out a little too quick for both map view and scene view.

 

Not sure how to refine the mouse wheel configurations with ArcGIS JavaScript SDK 

"dependencies": {
"@arcgis/core": "^4.29.2",
"@esri/calcite-components-react": "^2.6.0",

 

Looking forward to your tips and solutions...

 

 

Kind regards,

Ted

 

 

0 Kudos
5 Replies
TedZhou
Occasional Contributor

I saw those settings for old ArcGis as below:

esri.config.defaults.map.zoomDuration = 250; //time in milliseconds; default is 250
esri.config.defaults.map.zoomRate = 25; //refresh rate of zoom animation; default is 25

esri/config | API Reference | ArcGIS API for JavaScript 3.46 | ArcGIS Developer

But I did not see relevant information within config class of latest ArcGIS Maps SDK for JavaScript (4.31)  yet

config | API Reference | ArcGIS Maps SDK for JavaScript 4.31 | Esri Developer

 

0 Kudos
TedZhou
Occasional Contributor
require([
  "esri/Map",
  "esri/views/MapView"
], function(Map, MapView) {
  
  // Create a map
  var map = new Map({
    basemap: "streets"
  });

  // Create a view and set the zoom rate and duration
  var view = new MapView({
    container: "viewDiv",  // Reference to the DOM node that will contain the view
    map: map,              // Reference to the map object created before the view
    center: [151.2093, -33.8688], // Longitude, latitude
    zoom: 10,              // Initial zoom level
    zoomRate: 0.5,         // Zoom rate (default is 0.1)
    zoomDuration: 1000     // Zoom duration in milliseconds (default is 500)
  });

});
0 Kudos
BillFox
MVP Frequent Contributor
JonathanDawe3
Occasional Contributor

I would also check whether you have LODs defined in you map. 

If you have not due to one of the reasons explained there, then the mapview effective LODs defaults to null. In my experience this causes extremely sharp zooming when using the mouse wheel. 

TedZhou
Occasional Contributor

Thanks for your kind tips and brilliant suggestions.

I will examine anything we could be refined with LOD.

Best wishes to Jonathan.

 

 

 

0 Kudos