> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/ios/maps/llms.txt)

# Find features at a point

![Query the map for rendered features belonging to a specific layer.](https://docs.mapbox.com/ios/assets/ideal-img/maps-examples-features-at-point.0bfefe9.480.png)

This example demonstrates how to interact with features at specific points on the map using the **Mapbox Maps SDK for iOS**.

The example uses the [`MapView`](https://docs.mapbox.com/ios/maps/api/latest/documentation/mapboxmaps/map-view/) class with options to center the map over the United States. It imports a [GeoJSON data source](https://docs.mapbox.com/ios/maps/api/latest/documentation/mapboxmaps/geojsonsource/) and adds a [`FillLayer`](https://docs.mapbox.com/ios/maps/api/latest/documentation/mapboxmaps/filllayer/) with minimal styling to represent US states. It uses the [`GesturesManager`](https://docs.mapbox.com/ios/maps/api/latest/documentation/mapboxmaps/gesturemanager/) class and the [`onLayerTap`](https://docs.mapbox.com/ios/maps/api/latest/documentation/mapboxmaps/gesturemanager/onlayertap(_:handler:)/) method to allow users to tap on the states to display an alert with the selected state's name.

> **Note: iOS Examples App Available**
> 
> This example code is part of the **Maps SDK for iOS Examples App**, a working iOS project [available on Github](https://github.com/mapbox/mapbox-maps-ios/tree/11.33.0/Sources/Examples). iOS developers are encouraged to run the examples app locally to interact with this example in an emulator and explore other features of the Maps SDK.
> 
> See our [Run the Maps SDK for iOS Examples App](https://docs.mapbox.com/help/tutorials/maps-sdk-ios-examples-app/) tutorial for step-by-step instructions.

**Swift**

Title: `FeaturesAtPointExample.swift`

[View on GitHub](https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/Examples/All%20Examples/FeaturesAtPointExample.swift)

```swift
import UIKit
import MapboxMaps

final class ViewController: UIViewController {
    private var cancelables = Set<AnyCancelable>()
    private var mapView: MapView!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Center the map over the United States.
        let centerCoordinate = CLLocationCoordinate2D(latitude: 39.368279,
                                                      longitude: -97.646484)
        let options = MapInitOptions(cameraOptions: CameraOptions(center: centerCoordinate, zoom: 2.4))

        mapView = MapView(frame: view.bounds, mapInitOptions: options)
        mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        view.addSubview(mapView)

        // Allows the view controller to receive information about map events.
        mapView.mapboxMap.onMapLoaded.observeNext { _ in
            self.setupExample()

            
            
        }.store(in: &cancelables)

        // Set up the tap gesture
        mapView.mapboxMap.addInteraction(TapInteraction(.layer("US-states")) { [weak self] feature, _ in
            if case let .string(stateName) = feature.properties["STATE_NAME"] {
                    self?.showAlert(with: "You selected \(stateName)")
            }
            return true
        })
    }

    func setupExample() {
        // Create a new GeoJSON data source which gets its data from an external URL.
        var geoJSONSource = GeoJSONSource(id: "US-states-vector-source")
        geoJSONSource.data = .string("https://docs.mapbox.com/mapbox-gl-js/assets/us_states.geojson")

        // Create a new fill layer associated with the data source.
        var fillLayer = FillLayer(id: "US-states", source: geoJSONSource.id)
        fillLayer.sourceLayer = "state_county_population_2014_cen"

        // Apply basic styling to the fill layer.
        fillLayer.fillColor = .constant(StyleColor(.blue))
        fillLayer.fillOpacity = .constant(0.3)
        fillLayer.fillOutlineColor = .constant(StyleColor(.black))

        // Add the data source and style layer to the map.
        try! mapView.mapboxMap.addSource(geoJSONSource)
        try! mapView.mapboxMap.addLayer(fillLayer, layerPosition: nil)
    }
}
```