Select to view content in your preferred language

How to add custom visible scales

1339
4
02-10-2021 09:01 AM
VeliAlkan
New Contributor

Hi all,

I'm creating a map application using the ArcGIS API for JS v4.18. I'm running into an issue where I can't add custom visible scales as in the Web AppBuilder.

It goes now to maxZoom 22 and I would add 3 more scales so I can go to maxZoom 25, as I have done in the Web AppBuilder. I tried increasing the maxZoom, but it didn't work out. I'm using the OSM basemap by Esri.

Is there a way to set custom scales/zoomlevels? And if so, how could I do that? 

Thanks for any help!

 

0 Kudos
4 Replies
RickeyFight
MVP Regular Contributor

@VeliAlkan 

 

Have you added them to  custom visible scales ? 

 

RickeyFight_0-1612981066614.png

 

0 Kudos
VeliAlkan
New Contributor

Yes. However, this is in the web AppBuilder where i can add more scales. So i was wondering how i could do the same with the JS 4x API.

0 Kudos
RickeyFight
MVP Regular Contributor

@VeliAlkan 

 

Have you looked here:

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleRangeSlider-ScaleRan...

 

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

 

Example:
view.constraints = {
  geometry: {            // Constrain lateral movement to Lower Manhattan
    type: "extent",
    xmin: -74.020,
    ymin:  40.700,
    xmax: -73.971,
    ymax:  40.73
  },
  minScale: 500000,      // User cannot zoom out beyond a scale of 1:500,000
  maxScale: 0,           // User can overzoom tiles
  rotationEnabled: false // Disables map rotation
};
0 Kudos
RobertScheitlin__GISP
MVP Emeritus