This is a multi-language repository that contains documentation and sample code for creating custom URL schemes in Collector for ArcGIS.
- Collector for ArcGIS 10.4.0 or later on iOS and Windows 10, and Collector for ArcGIS 10.4.1 or later on Android
- Documentation on the URL scheme structure
- Sample code for iOS (Swift), Windows (.NET), Android (Java), and Python
Read the following documentation and clone down the appropriate language into your development environment.
A URL scheme allows you to launch a native app from another app, website, or email. You can set options in the URL that will be passed to the app you want to open, causing it to perform specific functions, such as opening a web map and centering the map on a given location. This capability is available on all platforms.
Support for featureSourceURL and featureAttributes parameters is available in Collector 17.0.3 or later (iOS and Android only).
All Collector URL schemes start with the identifier arcgis-collector
and can contain additional parameters that follow the form:
arcgis-collector://?parameter=value¶meter=value
The remainder of this topic describes the various parameters Collector currently supports.
This is one of the simplest schemes that can be used. The following example URL scheme demonstrates how to open a specific map within Collector.
itemID
: The web map to open in Collector.
The following example URL defines opening a web map:
arcgis-collector://?itemID=35b1ccecf226485ea7d593f100996b49
The location on which to center the map.
center
: (optional) Specified as a set of latitude, longitude (y,x) coordinates. Coordinates must be in WGS84.
The following example URL defines a map to open and a location to center the map:
arcgis-collector://?itemID=35b1ccecf226485ea7d593f100996b49¢er=34.0547155,-117.1961714
Starts a feature collection for a specific layer in the map.
featureSourceURL
: (optional) The URL to the layer or table in which to collect a feature.
This will start the collect activity and filter the list of available feature templates to those associated with the featureSourceURL
.
If center
is passed this will be used as the geometry for a point feature, or the first vertex in a line or polygon feature. Collection of new related tables is not supported.
The following example URL initiates a feature collection for a layer, and the center is used to define the new feature's geometry:
arcgis-collector://?itemID=5d417865c4c947d19a26a13c7d320323¢er=43.524080, 5.445545&featureSourceURL=http://sampleserver5a.arcgisonline.com/arcgis/rest/services/LocalGovernment/Recreation/FeatureServer/0
Include a set of attribute field values to populate to the new feature collection.
featureAttributes
: (optional) A JSON dictionary of attributes to apply to the new feature collection.
AfeatureSourceURL
must be passed.
All attribute values specified will overwrite any existing values present. If a field is not present, or the type is incorrect, the attribute value will be ignored.
Date fields should be represented as a numeric value (ms since epoch time). Fields with an associated coded domain value should use the domain code. Do not use the domain description.
Feature attributes should be URL encoded prior to being passed to Collector.
The following example URL specifies a layer to start a collection activity, uses the center
parameter for the geometry, and includes values to populate two fields:
arcgis-collector://?itemID=5d417865c4c947d19a26a13c7d320323¢er=43.524080, 5.445545&featureSourceURL=http://sampleserver5a.arcgisonline.com/arcgis/rest/services/LocalGovernment/Recreation/FeatureServer/0&featureAttributes={”quality”:2,“observed”:1502917218285}
Feature attributes should be URL encoded prior to being passed to Collector.
The following URL is identical to the previous example, only this has been URL encoded:
arcgis-collector://?itemID=5d417865c4c947d19a26a13c7d320323¢er=43.524080, 5.445545&featureSourceURL=http://sampleserver5a.arcgisonline.com/arcgis/rest/services/LocalGovernment/Recreation/FeatureServer/0&featureAttributes=%7B%22quality%22:2,%22observed%22:1502917218285%7D
If an error is encountered when processing a URL scheme with an itemID
, the user will receive an alert. Errors encountered in processing center
, featureSourceURL
, and featureAttributes
parameters will not be presented to the user.
- Collector for ArcGIS documentation
- Navigator for ArcGIS integration repository
- Apple's guide to custom URL schemes
Find a bug or want to request a new feature? Please let us know by submitting an issue. Thank you!
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
Copyright 2016 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's license.txt file.
[](Esri Tags: iOS Windows Collector URL-Scheme C-Sharp) [](Esri Language: Swift)