symbols zoom match with map zoom in 4.X version

683
2
01-08-2021 11:48 PM
rayza
by
New Contributor

I'm a freshman to use ArcGIS API for js. I know it can do this by ScaleDependentRenderer in 3.X, it seems that the ScaleDependentRenderer function was not come out, according to this web page,  how to make it?

2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

At 4.x you can watch the View.stationary property to check when the view is done animating, being navigated or resizing. Once the view is stationary then check the view.scale and at the desired scale, change your layer's renderer. 

Check out this super simple test app for how it can be done. 

Since you mentioned you are new to 4.x, you may find the following guide docs useful. 

1. Visualization overview

2. Watching for property changes

3. Visualization samples

Hope this helps,

-Undral

0 Kudos
MatthewPilgrim
New Contributor III

Undral, your code example link is broken.  Any chance you could republish please?  I'm trying to swap between an icon at the centre of a feaure when zoomed out to the feature bounbary when zoomed in (I have one json layer with multi-polygons).  

Thanks, Matthew

 

0 Kudos