Add a feature layer
Learn how to use a URL to access and display a feature layer in a map.
A map contains layers of geographic data. A map contains a basemap layer and, optionally, one or more data layers. This tutorial shows you how to access and display a feature layer in a map. You access feature layers with an item ID or URL. You will use URLs to access the Trailheads, Trails, and Parks and Open Spaces feature layers and display them in a map.
The following are required for this tutorial:
- An ArcGIS account to access your API keys. If you don't have an account, sign up for free.
- Your system meets the system requirements.
Steps
Add a layer to the map
In the project navigator, open the ViewController.swift file. Update the
setupMap()
method to create anAGSServiceFeatureTable
to access the trail heads data and anAGSFeatureLayer
to view it. Add the layer to the map's operational layers.Press Command-R to run the app in the iOS Simulator.
Congratulations, you're done!
The app should run and show features displayed on top of a basemap. Compare your solution with our completed solution project.