When you publish a map service to your ArcGIS Server site, you can optionally choose to allow clients to dynamically change layer appearance and behavior in your map service.
Determining which layers will appear in a map, layer symbology, layer order and position, labeling, and more, can be achieved through the use of dynamic layers. In this way, dynamic layers can increase the amount of interaction that users have with your maps. Consider a scenario in which you'll do the following:
- Create a map document with a U.S. states layer.
- Apply a color classification based on each state's population in 2010.
- Publish the map as a service to your ArcGIS Enterprise organization.
- Consume the service in an app such as Map Viewer or a custom ArcGIS Maps SDK for JavaScript web app.
- Enable users of your web app to display each state's population using a different color ramp.
By activating dynamic layers in your map service, you provide clients with flexibility to change the state symbols in the web app. ArcGIS Server does the work of applying the modified color ramp and returns the resulting map image to the client application.
Dynamic workspaces
If you want to dynamically add data—such as feature layers, feature classes, feature attribute tables, shapefiles, rasters, or stand-alone tables—to your map service, you must set up a workspace to contain the data you want to add.
Dynamic workspaces can be any supported database, enterprise geodatabase, file geodatabase, or file directory on disk that is accessible to the ArcGIS Server site.
When you choose a workspace, you can assign an ID to uniquely identify the workspace within the pool of workspaces available to the map service. The map service uses this ID to connect to the data source specified in dynamic layer requests. This ID is private to the service and only accessible to the administrator or service owner.
You have the option to modify the ID when you configure the dynamic workspace for your map service.
Considerations when choosing a dynamic workspace
When choosing a dynamic workspace, it is recommended that the workspace only contain the layers and tables necessary to support the map service.
If you choose an enterprise geodatabase or database as your dynamic workspace, grant minimum privileges (data viewer) on the data to the account that connects to the database. If possible, have a separate production database to use as your dynamic workspace. To learn more about data access privileges in a database, see one of the following help pages:
- User privileges in IBM Db2
- User privileges in Microsoft SQL Server
- User privileges in Oracle
- User privileges in PostgreSQL
- User privileges in SAP HANA
- User privileges in Teradata Vantage
If the above options are not possible in your environment, consider restricting access to your map services and web applications.
You may also consider encrypting communication between the web application and your map service using HTTPS. This encrypts service requests sent by the web application and helps prevent a malicious party from obtaining the workspace ID. To learn more, see Modify permissions for a service or folder.
Requirements for dynamic layers
The ArcGIS Server account must have at least read access to the dynamic workspaces that contain the data you want to dynamically add to the map service. To learn more about setting share and file permissions on your workspaces before publishing, see Make your data accessible to ArcGIS Server.
For a full list of dynamic layer requirements and the functionality exposed by dynamic layers in a map service, see Supported functionality in map services.