Start a local feature service and display its features in a map.
For executing offline geoprocessing tasks in your applicationss via an offline (local) server.
A Local Server and Local Feature Service will automatically be started. Once started then a FeatureLayer 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 feature service.
- Instantiate
LocalFeatureService(Url)to create a local feature service with the given url path to mpk file. - Start the service asynchronously with
LocalFeatureService.StartAsync(). The service will be added to the local server automatically.
- Instantiate
- Create an event handler for the
LocalFeatureService.StatusChangedevent. This will run whenever the status of the local service has changed. - When the service's status has changed to
Started, create a feature layer from local feature service.- Create a
ServiceFeatureTable(Url)using the URL for the feature layer. - Create feature layer from service feature table using
new FeatureLayer(ServiceFeatureTable). - Load the layer asynchronously using
FeatureLayer.LoadAsync().
- Create a
- Add feature layer to map using
Map.OperationalLayers.Add(FeatureLayer).
- FeatureLayer
- LocalFeatureService
- LocalServer
- LocalServerStatus
- StatusChangedEvent
This sample downloads the following items from ArcGIS Online automatically:
- PointsofInterest.mpkx - This map package is included in the ArcGIS sample data.
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.
feature service, local, offline, server, service
