To make a map available on the web, you first author it in ArcGIS Desktop and then share it to the web. If you use ArcMap, you publish your map to ArcGIS Server as a map service. If you use ArcGIS Pro, you can share it as a web map to your ArcGIS Enterprise portal, powered by a map service in a federated ArcGIS Server site.
Many of the things you can do with map services require some preparation in the initial authoring phase. The following are things to consider when making a map that you plan to publish to your site.
General tips
The following tips are important for all map documents that will be published to your ArcGIS Server site:
- Avoid using nonalphanumeric characters (other than spaces) in data frame or layer names. When you publish a service, your data frame and layer names are sometimes used in URLs, cache folder names, and web service request parameters. Nonalphanumeric characters may not be interpreted correctly in these situations. Be cautious when your service is exposed through OGC specifications. For example, see Available WMS service properties for a list of characters that should never be used with WMS services.
- Remove sensitive information from the document properties. ArcGIS Server includes the Services Directory, which allows users to browse the contents of your server and obtain metadata about your services. Even if you plan to allow your services to be publicly visible through the Services Directory (the default configuration), there still may be some sensitive information in your map document that you don't want to share. To see what information might be visible, open your map document in ArcMap and choose File > Map Document Properties from the main menu. When you publish your map, you can remove any author user names, comments, or other information that you don't want to be visible through the Service Editor. You should edit the information as necessary to reflect the purpose and intended audience of your map service.
- Remove any map service layers from the map document. Publishing a map document with an embedded service layer is not permitted.
- Explicitly set a data frame background color instead of leaving the default null background color. The map service treats the background color as transparent, so you should avoid choosing a color found elsewhere in your map. To avoid white areas of your map becoming transparent, you can set the background color to off-white (example: RGB 254, 255, 255).
You can set the background color on the Frame tab of the Data Frame Properties dialog box.
Set up the map document to preserve layer and table IDs
In earlier versions of ArcGIS Server, the layer and table IDs of a map and feature services were not preserved after altering the source map document. This required you to update any client applications consuming layers and tables to use the updated IDs. To avoid updating client applications, it is recommended that you configure the map document to preserve the layer and table IDs as described below.
- Open the source map document (MXD) in ArcMap.
- Right-click the name of the desired data frame and click Properties.
- On the Data Frame Properties dialog box, click General and click Allow assignment of unique numeric IDs for map service publishing.
- Click OK.
ArcMap automatically assigns sequential IDs to each layer and table in the data frame.
- Optionally assign custom IDs to layers and tables.
- Right-click the layer or table to which you want to assign a custom ID, and click Properties.
- On the Layer Properties dialog box, click General and assign an integer in the Layer ID field.
- Click OK.
- Repeat the above substeps for each layer or table.
- Publish the map document or overwrite the existing service.
The layer IDs are now preserved after publishing. You'll no longer be required to alter client applications after altering the source map document.
Cache the map for better performance
If your map contains data that is unlikely to change, consider caching your map for better performance. When you cache your map, you create a set of prerendered map images at certain scale levels. The actual caching happens after you've published your map as a service. However, if you know that you're going to cache the map, this influences the map authoring process. You want to author the map so that it looks good at all the scales you're going to cache. You can use any cartographic tools without an effect on performance, because the cached tiles are only pictures of the data; the actual rendering and labeling engines are not used after you create the cache.
If you cannot cache your map, the rendering and labeling engines affect the performance of the map service. For more information, see What is map caching.
Performance tips for uncached maps
You should create a map cache whenever it's appropriate. However, if you have large amounts of data that are frequently changing, it may not be feasible for you to create and maintain a map cache. If this is the case, you can use the tips below to improve the performance of your map. When you're in the process of publishing your map document, you can analyze your map with the Service Editor. This can help you quickly identify ways to improve the performance of your map document.
Set scale-dependent rendering for data layers—Use scale-dependent rendering to ensure that unneeded layers are not drawn when the map is zoomed out. Data-intensive or detailed layers may be more appropriate only when the map is zoomed in to a larger scale.
Remove unused layers and data frames—Check both the page layout and data views and ensure that your map document is clear of data frames and layers that are unrelated to the map's purpose. For example, if the page layout view contains data frames that will not be shown in any application that uses the service, remove the data frames.
Use definition queries appropriately—A definition query can act as a filter to limit the amount of data on the map, thereby causing it to be drawn faster. For example, if you're creating a map of a state and your feature class contains data for the entire country, you can use a definition query to display only those features that fall within the state boundaries. Be aware that some complex queries may negatively affect performance.
Simplify layer symbology—Complex symbols can take much longer to draw than simple symbols. Use simple line and fill symbols where possible, avoiding symbology that contains multiple layers, complicated dash patterns, hash lines, or outlines. Highway shield symbols may also slow drawing performance.
When using a picture fill symbol, you can improve performance by using an EMF file instead of a BMP.
One way to simplify some of the symbology in your map is to use the ESRI_Optimized style. This style contains both line and fill symbols that are designed to perform well while maintaining a visual appearance similar to their counterparts in the default Esri style. See Managing style contents in the ArcGIS Help to learn how to work with this style.
If you're creating a cached map service, simplifying your map does not affect the speed of the finished map delivery; it only affects the speed of the cache creation. If your cache already takes a reasonable amount of time to build, you may not need to worry about symbol simplification.
Use annotation instead of labels—Since labels require the computer to determine placement, it's generally faster to use an annotation layer.
Simplify labels—If your map contains labels, use the label and feature conflict weights sparingly. Halos, offsets, and other label effects also slow down performance.
Set scale-dependent rendering for labels—When a map is zoomed out, more labels need to be drawn, which takes time. Examine your map document and determine whether some labels do not need to be shown at smaller scales.
Use the same coordinate system for your data and map—When your source data and your map document have differing coordinate systems, your data has to be projected on the fly, thereby slowing performance. For optimal performance, use the same coordinate system for both your data and your map document. If this is not possible, make sure appropriate geographic transformations are applied to the layers that need to be projected on the fly.
Adjust the length of time the browser will use a response in its cache—When your map is viewed in a web browser, the map image response from the server is cached by the browser and reused for a certain period of time. Depending on how your map service and its associated data are used in applications, you may consider adjusting the length of time the browser will use a response in its cache. For details, see Improve map service display performance.
Network analysis
If you're going to use this map for network analysis on the server, you need to include a network analysis layer that references a network dataset. When you publish the map service, you have the option to enable Network Analysis capabilities. This creates a web service for executing network analysis tasks on your map.