jay.gregory

Polygon drawing order for mashups - REST API results

Discussion created by jay.gregory on Nov 26, 2012
Hi - I would like to know how the REST API returns features to specify drawing order of a polygon layer using a unique value renderer.  The JS API must know how (because it does it correctly) but we're querying the REST endpoint directly for use in a mash-up. 
We're trying to visualize hurricane wind swaths rendered by speed.  So we have speeds of 58 mph, 32 mph, 74 mph, and error swaths, and they need to be drawn in a specific order (error, 32, 58, 74).  Even when I publish with symbol levels enabled, the web service doesn't exactly return things in a preferred order, so a developer couldn't use a "first in first out" or "last in first out" methodology.
The REST API returns json as 74, 58, 32, error, 74, 58, 32, error, 74.... until there is no more polygons left.  Instead of returning all the 74 polygons first, and then 58 second, etc. etc.  We could of course make specific rules for the hurricane layer, but we want something that is repeatable no matter what kind of polygon layer we use. 
The way I've worked around this currently is dissolving the layer based on symbol, so it just returns 74, 58, 32, error (since there is only one polygon per symbol), but was curious if there is any other way to specify how the REST API returns features....
Like I said, the JS API does it correctly, so it must know how to do that from somewhere!

Thanks for your help!

Jay

Outcomes