Is there a way to change the drawing order in my web map?

4742
9
10-04-2017 04:53 PM
New Contributor III

Hi I know how to change the drawing order in my working MXD but when I publish the service, the drawing order doesn't seem to carry over. Is there a way to change the drawing order in javascript? I would like certain data points to show up behind or in front of others. 

9 Replies
MVP Esteemed Contributor

Melissa,

   Can you give more detail here. When you change drawing order in a MXD and publish that MXD as a map service it should definitely maintain your drawing order.

Reply
0 Kudos
Regular Contributor

Hi Melissa, 

Are you talking about the drawing order of different layers, or the drawing order of points within one layer?

Symbol Level Drawing isn't supported in ArcGIS Online currently from what I can see - I've found a couple of ideas if you want to vote for it to be included:

 


Carmel

New Contributor III

Hi Carmel, 

Yes I am looking for the points in one layer to draw in a certain order. Some of my points which occur more frequently throughout the map take over and they draw on top of everything else. I would like the less frequent points to draw on top. I figured out how to do it in the MXD but when publishing the service, "analyze" threw up a bunch of warning flags and it didn't appear to carry over to WAB. 

Thanks for the info!

Melissa 

Regular Contributor

Hi Melissa,

There might be a workaround depending on if the points are easily filtered based on how frequent they are. If so, add the same layer to the web map twice, apply a filter to the top layer to only display the less frequently drawn points and a filter to the bottom layer to show the most frequently drawn points. 

Just be aware that this might impact other widgets looking at this data in WAB.

Carmel

Reply
0 Kudos
Occasional Contributor III

Not tested it, but is one workaround to:

  • Add an integer field
  • Apply a ranking to it based upon attribute query/calculate field 
    • i.e. Important features = 1; lower priority features = 2
  • Perform a sort on this new field, with higher priority features at the bottom of your table.
  • I think I am right in saying that a hosted feature layer will respect the drawing order based upon ObjectID
    • Will draw features based upon ObjectID field, so final render - features that are drawn last will be on top?
New Contributor II

This worked for me. A very simple and elegant solution in my case, since I needed large polygon features to load beneath small features. I sorted by area descending, published my web layer and it worked like a charm.

Reply
0 Kudos
New Contributor

This is exactly the problem I am having.

But not sure what you are doing to make changes??

I can sort by area, but how does that change your OBJECTID?

Sorry for being so dense.

 

Bruce

 

Reply
0 Kudos
New Contributor II

Hi Bruce,

Use the Sort geoprocessing tool, as opposed to sorting simply in the attribute table. The tool allows you to reorder your dataset and thus your ObjectID, so it will ask you which attribute to reference to determine the new order. Just point it to your calculated areas.

Carlisle

Reply
0 Kudos
New Contributor II

I have a similar problem and I have a shapefile that contains numerous overlapping features. In ArcMap I was able to use the 'sort' function to order all of the features in my shapefile by area/size so that the largest polygons were drawn on the bottom and the smallest polygons were drawn on top. When I bring the shapefile into ArcGIS Online, it maintains the order of the features in the attribute table, but it applies an arbitrary drawing order to those features - so ArcGIS Online is not drawing features according to the order they appear in the attribute table like ArcMap does. Additionally, it does not appear possible to use symbol level drawing in ArcGIS Online, which in ArcMap I had been using as an additional step to control the display of features.