How to set symbol levels/ordering with renderers?

2521
9
01-03-2017 03:21 PM
BryanChastain
New Contributor III

When I'm using a esri javascript renderer on a dynamic map service (e.g. ClassBreaksRenderer or UniqueValueRenderer), is there any way to set the symbol levels (i.e. drawing order) for each break/value?

For example:

var renderer = new UniqueValueRenderer(...);
renderer.addValue(1, none);
renderer.addValue(2, low);
renderer.addValue(3, medium);
renderer.addValue(4, high);
‍‍‍‍‍

Where, "none", "low", "medium", and "high" are SimpleMarkerSymbols, how can I ensure that the high (4) points always are on top of the medium (3), low (2) and none (1) points?

If I publish a service with the symbol levels defined in ArcMap, it obeys the symbol levels, but I want to be able to change the renderer dynamically and still obey the symbol levels.

Any ideas?

0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus

Bryan,

   I do not know of any support for symbol levels in the JS API renderers. ArcGIS Server has this ability because the image for the layer is rendered on the server using ArcObjects that has this ability. One workaround I can think of is to add a layer for each level (with a definition query applied) with the symbology you want and add each layer to the map in the priority order you are wishing to see.

0 Kudos
BryanChastain
New Contributor III

Yeah, I thought about that too, but that would get real messy. Right now I've already got 28 layers on the map service, and that would mean splitting it into 112+ layers. The dataset is large and is on the slow side to render as it is, so I'm thinking this would probably slow it down even more.

Do you think it might be accomplished with SOEs/SOIs on ArcGIS Server?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Very probable. I don't have any experience with that though. Why would you need to split all your layers?.. are you not just concerned about the drawing order of this one that you want to symbolize in code on the client? Can't you let ArcGIS Server handle the others.


0 Kudos
BryanChastain
New Contributor III

Ah yeah, it's complicated. The 28 existing sublayers are so the user can set custom breakpoints for the renderer for 28 different region/type combinations. For example, Region 1, Type A, set breakpoints to [0, 1, 2, 3]; Region 1, Type B, set breakpoints to [2, 3, 4, 5]; Region 2, Type A, set breakpoints to [2, 3, 6, 8]; etc. Each region/type combination has it's own dynamically-set set of breakpoints, but in the overall view of the map, it's the same 4 symbols everywhere.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Bryan,

   So are they symbolizing all 28 layer at the same time or just one at a time?

0 Kudos
BryanChastain
New Contributor III

Well it applies all the symbology all at the same time, but they have the ability to just change one layer's breakpoints and leave the rest the unchanged.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Well,  I thought that you might be able to add the additional layers at runtime for the specific layer that was being configured but that does not seem like an option. Good luck on this complicated app. I hope the LOE is worth what you are going get out of this.

0 Kudos
BryanChastain
New Contributor III

Heh, thanks - the customer gets what they want! The rest of it is working - was just wondering about the symbol ordering.

0 Kudos
AaronEvans3
New Contributor

Cool. I should be using geonet. Seems helpful.

0 Kudos