In ArcGIS Pro, you can share a map containing multiple layers (and stand-alone tables) as a web layer or service. When you share a web feature layer, map image layer, web tile layer, or map service, the layers in your map become service sublayers. Each sublayer is identified by a unique numeric ID that allows you to work with it or reference it in a web map or application. For example, you can reference a service sublayer by URL: https://<service-url>/<layerID>.
By default, each layer you share is automatically assigned an ID based on its drawing order in the Contents pane, beginning with 0 for the first layer. If you share selected layers from your map, the IDs are based on the sequence of the selected layers, including any group layers they are contained within. As layers are added, removed, or reordered, their IDs change accordingly.
You can manually assign layer IDs that remain static as the map is modified. You can enable this with the Allow assignment of unique numeric IDs for sharing web layers setting in the Map Properties dialog box. After this setting is activated, the ID for each layer becomes visible in Layer Properties dialog box where you can customize them before publishing.
As a best practice, manually assign layer IDs prior to publishing if you intend to overwrite the web layer or service in the future. Otherwise, service sublayer IDs can potentially change when the web layer or service is overwritten, causing disconnects in web applications that reference the service sublayer. Manually assigning IDs to layers in your map can help you avoid having to update service sublayer references in web applications should your map contents change. Before overwriting, review the assigned layer IDs and ensure they match existing service sublayer IDs.
Author layers and stand-alone tables with static IDs
To author layers and stand-alone tables with static IDs, follow these steps:
- Right-click the map in the Contents pane and click Properties .
- On the Map Properties dialog box, on the General tab, check Allow assignment of unique numeric IDs for sharing web layers and click OK.
Sequential IDs are assigned to each layer and stand-alone table in the map.
- Optionally, assign custom IDs to layers and stand-alone tables in the map.
- Right-click a layer or stand-alone table in the Contents pane and click Properties .
- On the Layer Properties or Standalone Table Properties dialog box, on the General tab, type a custom integer ID in the Layer ID or Table ID text box.
You should be intentional when assigning IDs, like sequentially numbering your layers in multiples of 10 (10, 20, 30, and so on). This provides space for the addition of future layers. For example, you can add layers between existing layers and assign IDs that are between multiples of 10 (15, 25, 35, and so on).
- Repeat the previous two steps for each layer or stand-alone table as necessary.
- Share the map as a web feature layer, map image layer, or map service.
The layers and stand-alone tables in the map have static IDs, eliminating the need to update client applications if the web layer or service is overwritten in the future.
Review assigned IDs when sharing web layers
Before sharing or overwriting a web layer, review the IDs assigned to layers and stand-alone tables in the map.
- In the Share As Web Layer pane, click the Content tab.
The new web layers and sublayers with assigned IDs are displayed in the pane. Review the ID for each sublayer. If you are overwriting a web layer, verify that the ID of each layer or stand-alone table matches the existing service sublayer ID.
If assigned IDs do not appear in the pane, ensure that the Allow assignment of unique numeric IDs for sharing web layers option is enabled on the Map Properties dialog box.
IDs do not appear for vector tile layers because they cannot be referenced by a service sublayer URL, or for web scene layers, which only have a single sublayer that is always set to 0.
- To change an ID, click the number next to the layer or stand-alone table.
The Layer Properties or Standalone Table Properties dialog box appears.
- On the General tab, provide a custom integer ID in the Layer ID or Table ID text box and click OK.
The assigned ID is updated in the Share As Web Layer pane.