Select to view content in your preferred language

How to create a renderer subject to the zoom level, LOD, or scale?

506
2
Jump to solution
08-22-2023 05:24 AM
ChungLam
New Contributor II

I would like to have a ClassBreakRenderer that could remove the polygon outline when the zoom level/LOD/Scale is below a certain threshold. How can I do it?

I can only find the `ScaleDependentRenderer` in legacy documentation: https://developers.arcgis.com/javascript/3/jsapi/scaledependentrenderer-amd.html is the closest result; however, there is no such class available in the latest JS SDK.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ChungLam
New Contributor II

Thank you, with your information I managed to dig out a simple sample that serves the purpose 🙂

 

View solution in original post

0 Kudos
2 Replies
JoelBennett
MVP Regular Contributor

Unfortunately the ScaleDependentRenderer was not migrated from 3x to 4x.  In addition, unlike in 3.x, you cannot create custom renderer modules in 4.x applications.  Therefore, you'll have to approach this differently in 4.x.

Basically, a ScaleDependentRenderer was a collection of other renderers, one of which would become active at a given scale range.  Therefore, in a 4.x application, you'll need to (1) create that collection of other renderers manually, (2) watch the scale of the view, and when it changes, (3) determine which renderer from the collection your layer should be using.

There's also more information in this thread.

ChungLam
New Contributor II

Thank you, with your information I managed to dig out a simple sample that serves the purpose 🙂

 

0 Kudos