Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 2.16 KB

File metadata and controls

50 lines (32 loc) · 2.16 KB

Local server feature layer

Start a local feature service and display its features in a map.

Image of local server feature layer

Use case

For executing offline geoprocessing tasks in your applicationss via an offline (local) server.

How to use the sample

A Local Server and Local Feature Service will automatically be started. Once started then a FeatureLayer will be created and added to the map.

How it works

  1. Create and run a local server with LocalServer.Instance.
  2. Start the server asynchronously with Server.StartAsync().
  3. Create and run a local feature service.
    1. Instantiate LocalFeatureService(Url) to create a local feature service with the given url path to mpk file.
    2. Start the service asynchronously with LocalFeatureService.StartAsync(). The service will be added to the local server automatically.
  4. Create an event handler for the LocalFeatureService.StatusChanged event. This will run whenever the status of the local service has changed.
  5. When the service's status has changed to Started, create a feature layer from local feature service.
    1. Create a ServiceFeatureTable(Url) using the URL for the feature layer.
    2. Create feature layer from service feature table using new FeatureLayer(ServiceFeatureTable).
    3. Load the layer asynchronously using FeatureLayer.LoadAsync().
  6. Add feature layer to map using Map.OperationalLayers.Add(FeatureLayer).

Relevant API

  • FeatureLayer
  • LocalFeatureService
  • LocalServer
  • LocalServerStatus
  • StatusChangedEvent

Offline data

This sample downloads the following items from ArcGIS Online automatically:

Additional information

ArcGIS Maps SDK for Local Server is deprecated. The last release of Local Server will be ArcGIS Maps SDK for Local Server 200.8. For more information, see the deprecation announcement.

Tags

feature service, local, offline, server, service