Can I use my own polygon pattern for symbology in ArcGIS Online?

12561
15
Jump to solution
06-01-2017 09:48 AM
EmilyLee2
New Contributor III

Hello GeoNet,

I wonder if it is possible to use my own polygon pattern for symbology on ArcGIS Online like points do.  I have a set of standard pattern for land use, but they are not solid colors.  

Ex:

    

And when I tried to pre-set the symbology before publishing the service online, those came out empty (hollow with no color) or solid black instead.  Like this:

Any idea please?

Thank you!

Emily

3 Solutions

Accepted Solutions
CarmelConnolly
Esri Regular Contributor

Hi Emily, 

Currently hatched symbolgy like your examples are not supported in features services that are hosted in ArcGIS Online - unfortunately I can't find any documentation on it but there is an idea you can vote on: https://community.esri.com/ideas/6678 

If you have access to an ArcGIS Server, you could publish your layers to it - this retains the symbology. Then the layers can be added to your ArcGIS Online account. 

Carmel

View solution in original post

DeVoe_William
New Contributor II

It is possible to apply line fill or marker fill symbology on a Hosted Feature Service by modifying the service definition at the item’s REST endpoint - these symbologies seem to be supported by the current web map specification, but are not built into the graphical user interface. This process is a bit of a workaround, but it is possible.

 

  1. Navigate to the Admin REST endpoint for the hosted feature layer. See here for how to do this.

 

  1. Follow the directions in the previous link to update the service definition, but instead of modifying the query limit modify the drawingInfo section of the JSON - under "drawingInfo" will be arrays for each symbol defined on the layer - the ones that begin "type":"esriSFS"define the polygon fill - the ones that begin "type":"esriSLS"define the polygon border symbology.

 

  1. For each symbol in the layer modify the JSON to the attributes for the line fill or marker fill you are looking for. Full lists of supported symbol options: 

- simple fills

picture fills

- picture markers (for points)

- simple markers (for points)

- simple line symbols

 

For example: Changing "type":"esriSFS","style":"esriSFSSolid” to "type":"esriSFS","style":"esriSFSCross” would apply a cross hatching symbology, and retain the existing fill color. It can be helpful to use a JSON formatter when filling in these attributes, like the “Pretty JSON” plugin for Sublime Text.

 

  1. Navigate to the layer’s REST endpoint on the Hosted Feature layer’s item page, and view the layer on a map. The symbology does not seem to be pushed to the AGOL item, but will show up if you add the layer to a web map using the REST endpoint URL as opposed to referencing the item.
  2. An example of this: hosted feature service, map showing the symbology.

View solution in original post

EmilyL
by
Occasional Contributor

Hello. Your post really helps a lot of people. I thank you again!  When I update the color RGBA and click the 'Update Service Definition' on the bottom, it doesn't update when I check the layer on webmap when adding it from the URL.  When I go back to the Admin Update Service Definition page, the RGBA #s went back to original.  Am I missing some step?  Thank you.

View solution in original post

15 Replies
CarmelConnolly
Esri Regular Contributor

Hi Emily, 

Currently hatched symbolgy like your examples are not supported in features services that are hosted in ArcGIS Online - unfortunately I can't find any documentation on it but there is an idea you can vote on: https://community.esri.com/ideas/6678 

If you have access to an ArcGIS Server, you could publish your layers to it - this retains the symbology. Then the layers can be added to your ArcGIS Online account. 

Carmel

EmilyLee2
New Contributor III

I see. Thank you Carmel.

0 Kudos
DeVoe_William
New Contributor II

It is possible to apply line fill or marker fill symbology on a Hosted Feature Service by modifying the service definition at the item’s REST endpoint - these symbologies seem to be supported by the current web map specification, but are not built into the graphical user interface. This process is a bit of a workaround, but it is possible.

 

  1. Navigate to the Admin REST endpoint for the hosted feature layer. See here for how to do this.

 

  1. Follow the directions in the previous link to update the service definition, but instead of modifying the query limit modify the drawingInfo section of the JSON - under "drawingInfo" will be arrays for each symbol defined on the layer - the ones that begin "type":"esriSFS"define the polygon fill - the ones that begin "type":"esriSLS"define the polygon border symbology.

 

  1. For each symbol in the layer modify the JSON to the attributes for the line fill or marker fill you are looking for. Full lists of supported symbol options: 

- simple fills

picture fills

- picture markers (for points)

- simple markers (for points)

- simple line symbols

 

For example: Changing "type":"esriSFS","style":"esriSFSSolid” to "type":"esriSFS","style":"esriSFSCross” would apply a cross hatching symbology, and retain the existing fill color. It can be helpful to use a JSON formatter when filling in these attributes, like the “Pretty JSON” plugin for Sublime Text.

 

  1. Navigate to the layer’s REST endpoint on the Hosted Feature layer’s item page, and view the layer on a map. The symbology does not seem to be pushed to the AGOL item, but will show up if you add the layer to a web map using the REST endpoint URL as opposed to referencing the item.
  2. An example of this: hosted feature service, map showing the symbology.
EmilyL
by
Occasional Contributor

This is great! Thank you very much!

0 Kudos
BritaVespere
New Contributor III

Thank You for the info!

However, I see that your example explains how to change the fill style (and it works fine) - but is there a way how to change the color and width of the hatched lines? 

Or the best way to apply that sort of a fill would be using a picture fill with transparency (how I have applied the hatched fill symbology so far)?

Thanks!

JanetBrewster1
New Contributor II

Thank you!

Yes, this worked great. The only thing I had to change was in navigating to the Admin REST endpoint. The direction to  Replace "/" between the service name and FeatureServer to "."  resulted in an error. Just inserting "admin/" was enough.

I had defined hatches in ArcMap, prior to publishing as a hosted service, which was supposed to have worked. Two of the three layers with hatching came into AGOL just fine, but the third came in as a solid. No idea why...but this solved the problem. Thanks again -

Janet

0 Kudos
by Anonymous User
Not applicable

Hi William, 

Thank you for your extremely thorough and helpful comment. I was able to code in the diagonal hatching pattern to a hosted feature layer via the Admin REST Endpoint (screenshot below) and it autofills the entire layer. 

However, what I'd like to do is change the symbology of the map so that states vary between "esriSFSBackwardDiagonal," "esriSFSDiagonalCross," and "esriSFSSolid" based on different characteristics, as is shown in the screenshot of my ArcMap Desktop map below. 

Do you know if there's a way for me to symbolize using hatching like this on AGOL? I tried creating three layers and coding the Feature Host layers separately (third screenshot below), but the symbology disappears when I merge the layers. I'd like them to be in one layer because of how the legend needs to be laid out. 

Please let me know if there is a work-around for this!

Thanks,

Sophia

0 Kudos
DeVoe_William
New Contributor II

Yes, that should work as per my example above. Format your renderer JSON to use unique values and then specify each value and the symbology that goes with it. If you look at my renderer in the above example (go the feature service endpoint), it symbolizes unique values of the "Symbol" field. I would recommend pasting this render into a JSON parser/formatter and modifying it for your purposes.

0 Kudos
dfolch
by
New Contributor II

Thank you for this great tip.

For those wanting to control the color of the hatching or want different symbology by attribute, you might want to add these tasks before Step 1 from the @DeVoe_William post.

  1. From the Contents area, select the layer to work with
  2. Click the "Create View Layer" button to make a new view of the layer (not necessary, but helpful so you don't mess up your original data)
  3. In this new view layer, click the "Visualization" tab at the top
  4. From here you can change the default style. Make any changes to colors you normally would.
  5. Once you've made the changes, click "Save Layer" button in the upper-right
  6. At this point go back to the "Overview" tab and start Step 1 from the original response.

Notes about Step 1.

  • After you click "View" (and get to the page with "ArcGIS REST Services Directory" at the top), click the link under "Layers". From this page do the trick where you add "admin" to the URL.
  • You must change lastEditDate to null for your edits to be accepted.

Notes about Step 4.

  • The legend did not have the correct hatching colors in "Map Viewer Classic", but they were correct in "Map Viewer". The polygons themselves were correct in both.
0 Kudos