Scale Dependent Symbology for FeatureLayers

7099
17
02-01-2018 12:09 PM
MichaelHamsa
Occasional Contributor

Hello,

I'm looking for some information on Scale Dependent Symbology for FeatureLayers. For example, as the user zooms in or out, the symbol size is drawn relative to the view scale and it basically gets bigger or smaller in these cases. Now, when I load a map and zoom in or out, the symbol stays the same size on the map.

Is it possible to setup this type of scale dependent symbol rendering?

Thanks,

Mike...

17 Replies
MaraStoica4
Occasional Contributor

Mike,

You can create scale dependent symbology in Pro when you create your layer. See resource below please. 

Scale-based symbol classes—ArcGIS Pro | ArcGIS Desktop 

JensBuchta
Occasional Contributor

Mara,

I tried that setup and of course the symbology changes as expected in Pro.

However, after creating a Mobile Map Package from it and loading the Map Package into ArcGIS Runtime, the symbol does not change. It just sticks to one symbol, regardless of the map's scale.

Am I missing anything?

0 Kudos
MichaelHamsa
Occasional Contributor

Mara,

I'm seeing the same thing Jens is seeing - when I set the Reference Scale of my Map in ArcGIS Pro, the symbols are sized based on the reference scale I select in ArcGIS Pro. However when I create a Mobile Map Package, the Esri Runtime for .NET (v100.2) does not draw the symbols the same way based on the view scale - they are always drawn the same size regardless of what view scale the map is at.

Any ideas on what we are missing?

This is somewhat of an important feature for us, based on the type of data we are using. The map gets very cluttered at lower view scales if the symbols are not sized based on the view scale.

Thanks,

Mike...

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Support for reference scale is a high priority feature for ArcGIS Runtime and is on the roadmap for a future release. 

It may be possible to emulate this behavior by handling the navigation completed event then modifying the symbol size of graphics/features based on the current view scale. But that could become a relatively expensive operation depending on the frequency of navigation and the number of features/graphics.

Cheers

Mike

0 Kudos
MichaelHamsa
Occasional Contributor

Mike,

Thanks a lot for the response - I had a feeling this wasn't supported yet. I think it is an important feature, especially for your users and developers in the electric and gas utility community. It will be difficult to use the maps with the Esri Runtime in these industries until scale dependent symbology is supported.

Thanks again,

Mike...

0 Kudos
Nicholas-Furness
Esri Regular Contributor

To reiterate Michael Branscomb above, we agree that Reference Scale is important. Our goal is to introduce support for Reference Scale in the Q1/Q2 2019 Runtime release but of course schedules can change and functionality can slip (though we're working hard to hit that release).

In the meantime, some customers have had success with a partial workaround. The gist of it is that you define a symbol's size when authoring the map using an Arcade expression along the lines of (1/$view.scale)*1000000.

Some notes on this approach:

  • This is not true Reference Scale. Reference Scale is defined by the map or layer. This approach is a function of the layer's renderer.
  • You'd need to tweak the factor here for each layer to get close to what you want.
  • This requires that the layer be rendered in static mode. It is not currently supported in dynamic rendering mode (Arcade support in dynamic rendering mode is coming, but is not there yet).
  • You should use 100.3 or later for using this approach.

Hope this helps!

Nick.

MichaelHamsa
Occasional Contributor

Nicholas,

I really appreciate this information, it helps us plan out some direction for our development with the Runtime. In the meantime, would you be able to provide a code example we could use to try the Arcade expression? I'm wondering if we'd be able to make the code generic enough for us to use with all of our customers, or if we'd need to develop some type of configuration options by layer to set the scaling in the arcade expression correctly; some of our customers have 75 or 80 layers in their MMPKs.

Here's a shot of what that currently looks like zoomed out a few levels - all of these features/symbols need to be displayed at this level. As you zoom in, the symbols are scaled correctly and it looks very nice, maybe at a 1:50 or 1:100. But when you get out to around 1:400 it really looks bad. It's just hard to try to convince one of our electric utility customers to use this type of map at this point. So, we've been soft pedaling the Runtime development efforts until this improves.

.

Thanks again,

Mike...

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi Michael‌,

Not sure I have code available. At the moment, we don't expose the right properties on the symbol objects to modify the Arcade expression (deeper symbology API is coming in the next couple of releases too - you can imagine a lot of this is interrelated).

In the example I've seen, this Arcade expression is created in ArcGIS Pro to drive the symbol size:

Setting an Arcade expression to scale symbols relative to view scale

As you mention, it's not an ideal workflow to manage with a lot of layers. I'm not familiar with the Pro SDK, but I imagine you should be able to write something to manage this, or manage it with some Python code. However, as a proof of concept this should at least let you figure out if this workaround will work for you.

Alternatively, you can take the symbol definition JSON that this creates when the MMPK is generated, and modify that in the runtime to update as necessary, using AGSSymbol.fromJSON() to create a new symbol to apply to the layer. That's the code I have to work out how to dig up.

Cheers,

Nick.

MichaelHamsa
Occasional Contributor

Nicholas,

Thank you very much for this information - I just had an opportunity to do a little more testing with this approach and I have to say it works really well. With just a little effort I was able to setup several layers. However, I could not find a way to apply this same approach to text size - is there currently a way to use an Arcade expression to size the text based on view scale?

Here's what I'm seeing now - as I zoom out, the text basically covers everything on the map:

0 Kudos