Summary
Portal for ArcGIS Map Viewer Classic comes with a series of default Esri symbol sets that meet the needs of most organizations. If custom symbology is required, the steps below describe a method to configure the map viewer settings to use custom symbol sets.
Note:
If you are working with ArcGIS Pro and the new map viewer in ArcGIS online or Enterprise 10.9.1 please see this recommended workflow: Use Published 2D Symbols in ArcGIS Online
Procedure
Custom symbol sets are stored as items in a group. The map viewer searches for the group and then uses the symbol set items within it to populate the sets available.
-
Check the prerequisites for this workflow.
-
Create a group to contain the symbol sets.
- Log in to the Portal for ArcGIS website as an administrator of the organization.
- Create a group to contain the custom symbology, for example 'Custom Symbols'. This must be be accessible to everyone that uses the map viewer. Record the name of the group, as this is needed later. Refer to Portal for ArcGIS: Create groups for more information.
- Log in to the ArcGIS Portal Directory as an administrator of the organization. The URL is formatted as follows:
https://webadaptor.domain.com/arcgis/sharing/rest
- In the upper-right corner of the page, click the account name.
- In the User Groups section, click the name of the group created above and record the ID of the group for later use.
-
Configure the symbol set items.
Two separate items must be created for each symbol set added to the group. The title property must be the same for both items. This first item is for browsers that reference the symbols by value. The second item is for browsers that reference the symbols by URL.
Repeat the steps in this section to add additional custom symbol sets to the group. Distinguish each pairing of symbol set items using the title property.
-
Create the 'by value' item.
- In the upper-right corner of the page, click the account name.
- At the bottom of the page, click User Content.
- In the User Content page, click Add Item.
- In the Add Item page, specify a title for the item using the Title field. This is meaningful, as it is displayed in the map viewer.
- Specify the following information exactly as noted below:
- Tags: Symbol Set
- Type Keywords: marker, Symbol Set
- Type: Symbol Set
- If you want to display this symbol set as the default, add 'default' to the Type Keywords field.
- Click Add Item.
- Click Share Item.
- Share the item with everyone. In the group field, enter the ID of the group created above.
-
Create the URL item.
- In the upper-right corner of the page, click the account name.
- At the bottom of the page, click User Content.
- In the User Content page, click Add Item.
- In the Add Item page, enter the same title specified for the 'by value' item. The title must match the by value item exactly.
- Specify the following information exactly as noted below:
- Type: Symbol Set
- Type Keywords: by value, marker, Symbol Set
- Tags: Symbol Set
- If this is the default symbol set for the portal, add 'default' to the Type Keywords field.
- Click Add Item.
- Click Share Item.
- Share the item with everyone. In the group field, enter the ID of the group created above.
-
Create and publish custom symbols.
- In ArcMap, create a map that contains the custom symbology to be added to the symbol set. Refer to ArcMap: What are symbols and styles? for more information.
- Publish the map as a feature layer to the portal. Refer to Portal for ArcGIS: Publish hosted feature layers for more information.
-
Host the custom symbols.
Once the symbols have been published, download and host them on a web server in the organization. This is necessary to remove the dependency on the feature layer; the symbols are instead accessed from the web server.
- Create a virtual directory on the web server to contain the symbols. Verify read/write access to this directory and that it can be accessed by Portal for ArcGIS.
- Verify that the directory can be accessed via HTTPS.
- Log in to the ArcGIS Server Services Directory as an administrator of the organization. The URL is formatted
https://gisserver.arcgis.com:6443/arcgis/rest/services
- Click the Hosted folder and then click the name of the service published as a feature layer.
- Under Layers, click the first layer.
- Under Drawing Info, right-click each symbol and save to the virtual directory created on the web server.
- Repeat steps e and f for any additional layers.
-
Insert symbols into the symbol set.
Now that the symbols are hosted on the web server, the next step is adding them to the symbol set items created above. This process is complex and requires editing JSON. Access a text editor and the following resources before beginning.
- Log in to the ArcGIS Server Services Directory as an administrator of the organization. The URL is formatted.
https://gisserver.arcgis.com:6443/arcgis/rest/services
- Click the Hosted folder and then click the name of the service published as a feature layer.
- Under Layers, click the first layer.
- In the upper-left corner, click JSON. A raw view of the feature layer JSON is displayed.
- Search for the 'uniqueValueInfos' property.
- Beginning at the first open bracket after the property, copy all of the JSON info up to the closing bracket of the property. For example:
"uniqueValueInfos": [
{
Symbol0
...
},
{
Symbol1
...
},
]
- Paste the content into a JSON validator.
- Remove the following properties from each symbol definition JSON:
- value
- label
- description
- symbol
- Repeat steps a through h for any additional layers.
- Validate the JSON. Correct any errors. The validated JSON should look like this:
[
{
"type": "esriPMS",
"url": " d06b3aed-db09-4d17-b485-48596e3c925d",
"imageData": "iVBORw0KGgoAAAANSUhEUgAAABwAAAAc...",
"contentType": "image/png",
"width": 21,
"height": 21,
"angle": 0,
"xoffset": 0,
"yoffset": 0
}
]
- Copy and paste the validated JSON into a text editor.
- Update the JSON URL property to match the URL of the symbols hosted on the web server, for example:
"url": "https://webserver.domain.com/custom/hydrant.png",
- Validate the JSON and correct any errors.
- Minimize the JSON. Copy this content.
-
Add validated JSON to symbol sets.
Now that the symbol set JSON has been validated, the JSON can be uploaded to each symbol set item. Remember, there are two symbol set items: the 'by value item' and the 'URL item'. Each must be updated with the validated JSON.
- Log in to the ArcGIS Portal Directory as an administrator of the organization. The URL is formatted.
https://webadaptor.domain.com/arcgis/sharing/rest
- In the upper-right corner of the page, click the account name.
- At the bottom of the page, click User Content.
- In the items list, click the name of a symbol set item.
- Click Update Item.
- In the Text field, paste the minimized JSON.
- Click Update Item.
- Repeat these steps for the second symbol set item. Repeat these steps for any additional custom symbol sets created for the portal. Each symbol set requires the validated JSON and each symbol set item must be updated.
-
Expose custom symbols.
Now that all of the symbol sets have been updated, the last step is to configure the portal to expose the custom symbol sets in the map viewer. By default, it exposes the default Esri sets. Remove the default sets and replace them with the custom sets managed by the custom symbology group.
- Log in to the ArcGIS Portal Directory as an administrator of the organization. The URL is formatted:
https://webadaptor.domain.com/arcgis/sharing/rest
- Click the organization ID.
- At the bottom of the page, click Update.
- Locate the Symbol Sets Group Query field and update to the following:
title: "<name of custom symbols group>" AND owner: <group owner user name>
For example:
title: "Custom Symbols" AND owner: "admin"
- Click Update Organization.
The custom symbols are available in Map Viewer Classic. It may be necessary to clear the browser cache to confirm that the custom symbol sets are exposed. Optionally, delete the feature layer created. It is no longer needed.
Note:
If it is necessary to revert to the default Esri symbol sets, repeat the steps above and update the Symbol Sets Group Query field with title: "Esri Symbols" AND owner: "esri_en".