Set symbology in Map Viewer before data arrives

466
4
06-30-2022 05:43 PM
Lindsay
Occasional Contributor

Hi there,

I feel like I've been doing this the hard way and am hoping someone has a solution here.

I want to preset the symbology by one field type in Map Viewer (not in Classic) to unique types. I haven't figured out how to set the symbology until  after the data set is populating. Normally, that's what I do. I'll build the web map and show it to the client after I have their data, but this time, I have to build the map and have the portal ready before the data arrives.

Thanks in advance for your help.

4 Replies
JohannesLindner
MVP Frequent Contributor

I havent' found a way to do this without data.

I think the best (only?) way to do this is to create a dummy feature for each of the types you expect, configure the symbols, then delete the dummy features.


Have a great day!
Johannes
RussRoberts
Esri Notable Contributor

This is on our roadmap to support adding additional values to the types renderer that might not be there. Aiming for end of this year update.

jcarlson
MVP Esteemed Contributor

There are a couple ways to do this without data. One's simple enough, the other less so.

The easier way: If you want this configured on a per-map basis, open the map with the empty feature layer in ArcGIS Pro. From there, you can configure the symbology any way that you wish, including adding symbology categories for yet-to-be-added values. After configuring as you need, you can then save the web map from Pro with all the settings intact.

To then make this symbology the default for the layer definition, so that the symbology loads in any new maps elsewhere, simply open that map in the Classic map viewer and click "Save layer" in the contents panel. This saves the layer configuration back to the service itself.

The harder way: To do this for the layer's default settings directly (not using map), manipulating the service JSON is the only way for it. You can modify the service JSON through the REST endpoint, the Python API, or by using the AGOL Assistant. 

When you get the JSON, look for the drawingInfo object. It will look like this:

  "renderer": {
    "type": "simple",
    "symbol": {
      "color": [79, 129, 189, 0],
      "outline": {
        "color": [54, 93, 141, 255],
        "width": 1.5,
        "type": "esriSLS",
        "style": "esriSLSSolid"
      },
      "type": "esriSFS",
      "style": "esriSFSSolid"
    }
  },
  "transparency": 0
}

Mind, this example is for a very simple symbology type. Having a classified rendering style can get more complex very quickly. But by modifying this object and passing it back to the service, you can update the symbology to account for data types not present yet.

Try the Pro approach first, though.

- Josh Carlson
Kendall County GIS
Lindsay
Occasional Contributor

Thanks community for your replies. Great discussion. @jcarlson , I'm going to give this a go. @RussRoberts looking forward to this upgrade. @JoHo yes that's what I used to do too.

0 Kudos