To directly open a hyperlink that selects a feature in an ArcGIS Online Feature Layer using URL parameters, you can use one of the following methods:
Method 1: Using the ArcGIS Online Map Viewer URL with query Parameter
You can construct a URL that opens the feature layer in the ArcGIS Online Map Viewer and applies a filter to select the desired feature.
URL Structure:
https://www.arcgis.com/apps/mapviewer/index.html?webmap=<WebMapID>&query=<LayerID>,ISO_CC='USA'
Example URL:
For the given feature layer (id=ac80670eb213440ea5899bbf92a04998), you can use:
https://www.arcgis.com/apps/mapviewer/index.html?webmap=a1ed4a1b0e5e4d6d8e1a0b0c0d0e0f0&layers=ac80670eb213440ea5899bbf92a04998&query=ac80670eb213440ea5899bbf92a04998,ISO_CC='USA'
(Replace a1ed4a1b0e5e4d6d8e1a0b0c0d0e0f0 with the actual WebMap ID if known.)
Notes:
- The
webmap parameter is optional but helps if the layer is part of a web map.
- The
query parameter filters the layer (ISO_CC='USA' in this case).
Method 2: Using the ArcGIS Online Feature Layer REST API with where Parameter
If you want to open the layer in a way that highlights the feature (e.g., in a popup), you can use the REST endpoint.
URL Structure:
https://www.arcgis.com/home/item.html?id=<LayerID>&view=service&query=ISO_CC='USA'
Example URL:
https://www.arcgis.com/home/item.html?id=ac80670eb213440ea5899bbf92a04998&view=service&query=ISO_CC='USA'
Notes:
- This may not always zoom to the feature but will filter the table view.
Method 3: Using the ArcGIS API for JavaScript (Custom App)
If you have a custom app, you can pass URL parameters to select a feature.
Example URL:
https://your-custom-app.com/?layer=ac80670eb213440ea5899bbf92a04998&filter=ISO_CC='USA'
(Your app would need to read the URL and apply the filter.)
Method 4: Using the find Parameter in Map Viewer (Beta)
In newer versions of Map Viewer, you can use the find parameter to search for a feature.
Example URL:
https://www.arcgis.com/apps/mapviewer/index.html?find=USA&layer=ac80670eb213440ea5899bbf92a04998&field=ISO_CC
Best Approach:
- For end-users, Method 1 (Map Viewer URL with
query) is the simplest.
- For developers, Method 3 (custom app) provides the most control.
- If the layer is in a Web AppBuilder or Experience Builder app, you can also pass URL parameters to filter features.
Would you like help refining any of these methods for your specific use case?