Keeping consistent scale on monitors

782
4
05-22-2017 08:05 AM
EvonFranklin
New Contributor III

When I use different size monitors then try to `MapView.goTo(extent)`, it zooms in more or less depending on screen size. On larger resolution screens it zooms in a bit more than smaller ones, is there a way to set just how much zoom happens when I try to go to a feature?

Tags (1)
0 Kudos
4 Replies
MirHashmi
Occasional Contributor

Hi Evon,

You can achieve zooming to a particular level of your map by passing the zoom value to the same function as an option. The same function "MapView.goTo" accepts a second parameter as "Options" wherein one can define the zoom level.

For more information on these functions click here and here.

Thanks.

EvonFranklin
New Contributor III

goTo does accept additional parameters but it does not allow for zoom level, so I guess I am stuck again.

0 Kudos
HemingZhu
Occasional Contributor III

you could do like this:

mapView.constraints = {
   minScale: 295828763.795777, // the second lowest tile level -1
   maxScale: 564.248588 // the hightest tile level -20   
};

0 Kudos
KenBuja
MVP Esteemed Contributor

This is caused by using the tiled basemaps. They are set to show at a specific resolution or scale for each Level of Detail (LOD) and at a specific DPI. Since the resolution and the DPI of the monitors vary, this means the extent of the basemap will not be exactly the same on different monitors.

0 Kudos