Start the Local Server and Local Map Service, create an ArcGIS Map Image Layer from the Local Map Service, and add it to a map.
For executing offline geoprocessing tasks in your apps via an offline (local) server.
The Local Server and local map service will automatically be started and, once running, a map image layer will be created and added to the map.
- Create and run a local server with
LocalServer.Instance
. - Start the server asynchronously with
server.StartAsync()
. - Create and run a local service, example of running a
LocalMapService
.- Instantiate
LocalMapService(Url)
to create a local map service with the given URL path to the map package (mpkx
file). - Start the service asynchronously with
LocalMapService.StartAsync()
. The service is added to the Local Server automatically.
- Instantiate
- Create an ArcGIS map image layer from local map service.
- Create a
ArcGISMapImageLayer(Url)
from local map service url provided by theLocalMapService.Url
property. - Add the layer to the map's operational layers.
- Wait for the layer to load with
await myImageLayer.LoadAsync()
- Set the map view's extent to the layer's full extent.
- Create a
- ArcGISMapImageLayer
- LocalMapService
- LocalServer
- LocalServerStatus
This sample downloads the following items from ArcGIS Online automatically:
- RelationshipID.mpkx - This map package is included in the ArcGIS sample data.
Local Server can be downloaded for Windows and Linux platforms from the developers website. Local Server is not supported on macOS.
image, layer, local, offline, server