I am trying to create a custom expression on a feature so that it will re-size the symbology as I zoom in and out. Like this example ESRI Blog - https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/how-and-why-to-adjust-size-by-scale-...
However, everything I try, I keep getting errors.
I've also read this blog as well, but the steps are too complex for what I need to accomplish, as I don't have a layer I need to symbolize by attribute. - https://community.esri.com/t5/arcgis-living-atlas-blog/automatically-resize-symbols-by-map-scale-in/...
This is where I left off, basing off of the blogs:
I just have a simple layer for Manhole locations.
This layer is a part of a Web Application for our Asset Management database (bridges, dams, outfalls, signals, inlets, pavement, etc). So there will be a lot of layers involved. I made a custom symbol for the Manholes & Inlets, and you cannot see the detail when the symbols are a smaller size.
Can anyone help let me know how to fix my expression? I will need to do this will all of the layers involved.
The scales listed in the expression were from one of the blogs, I did not set them myself.
You can refer to the When page, but basically you need a default value at the very end for when none of the conditions are met. Just add ", 5" before the final parenthesis.
Thank you again. My script already has a ", 5" before the final parenthesis, so I added another just to see if it would work, but I am now getting a "Parse Error: Line 8: Unexpected identifier".
var vs = $view.scale
vs >=37000000, 30,
vs >=18500000, 20,
vs >=9300000, 10,
vs >=4700000, 8
vs >=2000000, 5, 5)
Thanks for catching that. Fixed and updated to the script below.
var vs = $view.scale
vs >=5000, 8,
vs >=2300, 15,
vs >=1200, 20,
vs >=600, 25, 5)
However, now this is what I'm getting -
But I don't believe it worked correctly. The symbols get smaller when I zoom in, and I wanted them to get larger. I also don't know what the legend is counting (>40, 30, 20, 10, etc). I still think I'm doing something wrong. Am I typing in the view scale incorrectly? I'm just super confused.
So, those numbers you're defining with your expression are just arbitrary values, they're not directly setting the symbol size number. What you'll need to do is to open the symbology settings to adjust the min/max values, as well as the min/max symbol sizes to match the min/max values from your expression.
I'm sorry, maybe my last question wasn't clear. I don't have the "View Scale Based" symbology options where you can customize a min/max. I only have the normal symbology options - choosing a symbol, transparency and visible range.