HOW TO

Copy symbology from a hosted feature layer and apply to it another feature layer in ArcGIS Online

Last Published: September 5, 2024

Summary

In some cases, when importing hosted feature layers published from ArcGIS Pro from another project in ArcGIS Online, the symbology is not preserved. This article highlights the workflow to transfer symbology from a hosted feature layer published from ArcGIS Pro to another layer in the admin REST endpoint in ArcGIS Online by copying its JSON script.

Procedure

Note:
This workflow works with hosted feature layer published from ArcGIS Pro. Symbology definition edited from ArcGIS REST Services Directory for layers added within ArcGIS Online is not honored and is reverted back to the default JSON definition.
  1. Copy the JSON script of the symbology.
    1. In ArcGIS Online, navigate to Content > My Content.
    2. On the My Content tab, select the item to open its item details page.
    3. On the item details page, select and click the feature layer containing the symbology.
    4. Scroll down to the URL section and click View. to open the ArcGIS REST Services Directory window.
Click View
  1. On the ArcGIS REST Services Directory window, under Layers, select and click the layer with the desired symbology. This article uses testing(0) as an example.
Layers in a hosted feature layer REST page
  1. Navigate to the Drawing Info section and copy the JSON script.
From the Drawing Info, copy the JSON script
  1. Transfer the copied JSON script to another layer.
    1. Repeat Steps 1c through 1f. In Step 1f, select the desired layer. This example uses TestCopySymbology2.
Note:
To edit the JSON script, access the ArcGIS REST Administrator Directory.
  1. On the ArcGIS REST Services Directory window, click Admin.
The Admin button on the ArcGIS REST Services Directory window
  1. Scroll down the page, under Supported Operations, click Update Definition.
Click Update Definition
  1. In the Update Layer Definition box, locate the lastEditDate, shcemaLastEditDate, and dataLastEditDate parameter, and delete the values.
The deleted values from the parameters in the Update Layer Definition text box
  1. In the Update Layer Definition box, locate the drawingInfo parameter, then paste the JSON script from the first layer and add a closing curly bracket at the end } (similar to the format shown in the example and screenshot below).
{
    "drawingInfo":{"renderer":{"type":"simple","symbol": 
{"type":"esriSMS","style":"esriSMScircle","color": 
[128,0,123,255],"size":4,"angle":0,"xoffset":0,"yoffset":0,"outline":"{"color":
[0,0,0,255],"width":1}}},"scaleSymbols":false,"transparency":0,"labelingInfo":null}
}
  1. Select True for ASync and select JSON for Format. Click Update Layer Definition.
Note:
If the schema of your layers do not match, for example if the second layer is missing a field or a domain that is used in the symbology (i.e. referenced in the drawing info), updating layer definition may still return success but the symbology of the layer won't change.

Article ID: 000027205

Software:
  • ArcGIS Online

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options