Select to view content in your preferred language

Odd behavior with decimal zoom values

1728
3
10-08-2017 07:48 PM
DeanKertai
Deactivated User

I'm experiencing an odd bug with zooming on a MapView with the javascript 4.5 API.

I can set the MapView zoom to any decimal value (ie: 15.1), but it always rounds down for any decimals that are between x.01 and x.49. I'm setting it by calling mapView.zoom = {Number}

So zoom level 17.1, 17.2, 17.3, 17.4, and 17.5 all look exactly the same, but every number between 17.6 and 17.9 are smoothly drawn as expected.

Any idea what could be causing this?

Thanks

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Dean,

   The zoom property of the MapView constructor is a number not a decimal property. This number represents the Level of Display (LOD) for the cached basemap. 

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom 

The value passed if a decimal will be rounded to the nearest integer value. There is no such zoom level as 17.1 or 17.2 as each LOD is comprised of a specific cache bundle with is pre-created images of the data as that determined scale level. 

DeanKertai
Deactivated User

Thanks for the reply Robert. 

That's a bit disappointing to hear though. The application I'm developing allows the user to select between various satellite imagery backgrounds (ERSI, Google, etc), so the pinch-to-zoom and mapping functionality is custom built, and the ESRI/Google layers just update to match the center point and zoom of the custom map.

Is there any way to set 'inbetween' zoom levels then? Or will I have to resort to the hacky method of scale-transforming the underlying div, like I do with Google Maps?

Thanks

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Dean,

   There is no way that I am aware of. You will probably have to resort to the scaling if that is something you absolutely have to have.