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.
Note:
If you do not manually assign layer IDs, you may encounter analyzer error 00374 when sharing web layers.
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.
To learn more about overwriting web layers and services, see Overwrite a web feature layer, Overwrite a map image layer, or Overwrite a map service.
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.
Tip:
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.
Note:
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.
Assign unique IDs to relates
When a layer (or table) is participating in a relate and is shared as a service sublayer, the relationship between each feature class and the table must be represented by different unique IDs at the service level. This prevents map or feature services from modifying IDs after changes are made to the map or geodatabase.
Caution:
In order to assign unique IDs to relates, the layers, tables, and attributed relationship classes (when applicable) must be added to the map. Without its presence in the map, the service cannot show any relationship between the layers and tables.
Use the Relates tab in the layer or table's properties to review and assign unique IDs. Follow these steps:
- Ensure the layer or table already participates in a relate.
- Right-click the map in the Contents pane and click Properties . On the General tab, check Allow assignment of unique numeric IDs for sharing web layers and click OK.
- Right-click the layer or table in the Contents pane and click Properties.
- On the Layer Properties or Standalone Table Properties dialog box, on the Relates tab, expand the relate.
- Expand the Relate IDs for sharing web layers section to view all relationships, and type a custom integer ID in the Relationship ID text box.