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 on the Map Properties dialog box. After this setting is activated, the ID for each layer becomes visible on the 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, compare and 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.
- Right-click a layer or stand-alone table in the Contents pane and click Properties
- 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.
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:
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.
If the relate is established before updating map properties, you may need to uncheck and recheck Allow assignment of unique numeric IDs for sharing web layers for unique IDs to display.
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.
Review assigned IDs when sharing web layers
Before sharing a web layer, review the IDs assigned to layers and stand-alone tables in the map. If you are overwriting a web layer, see Compare IDs when overwriting web layers.
- 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.
In this example, a map image layer is shared with an associated web feature layer. Layer and table IDs are assigned to the sublayers. 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.
Compare IDs when overwriting web layers
Before overwriting a web layer, compare the assigned IDs in the map with the sublayer IDs of the existing web layer.
- In the Overwrite Web Layer pane, under Finish Sharing, click Compare
to review discrepancies between the IDs in the current map and the existing web layer you are overwriting.
Note:
If the Compare button
is disabled, ensure that the Allow assignment of unique numeric IDs for sharing web layers option is enabled on the Map Properties dialog box.
Under Content, a warning appears if discrepancies are found, such as mismatched pairs of IDs and layer names between the map and the existing web layer. You can hover over the warning symbol
next to an ID to view information about the warning. Possible warnings are described in the following table:
Warning Explanation Suggested solutions Layer ID doesn't exist in the map.
A layer with the existing service sublayer ID was not found in the current map.
Ensure the layer is present in the current map and change its assigned ID to match the existing service sublayer ID.
Layer name for ID has changed.
A layer in the current map has the same ID as an existing service sublayer but has a different name.
Change the layer name to match the existing service sublayer name. Or, if another layer in the map has the same ID, assign a unique ID instead.
In this example, a warning appears because the table in the existing service is ID 2, but the stand-alone table in the map is assigned ID 4. If desired, you can resolve discrepancies by changing assigned IDs or layer names in the current map.
- To change an ID, under Current map, 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 Overwrite Web Layer pane.
- After verifying that the desired layer IDs are assigned in the map, you can click Publish when you are confident in your decision to overwrite the web layer.