Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1097 from Esri/Ting/New-Geotriggers-vNext
Browse files Browse the repository at this point in the history
New: `Set up location-driven geotriggers`
  • Loading branch information
yo1995 authored Aug 25, 2021
2 parents 0606420 + ec73e05 commit 28b7a41
Show file tree
Hide file tree
Showing 8 changed files with 525 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arcgis-ios-sdk-samples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

/* Begin PBXBuildFile section */
00069C77241C3B3B00FEE0EC /* ConvexHullViewController.swift in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00D4E8DB241AA18E002689DB /* ConvexHullViewController.swift */; };
000FFFB426CB043200E3CE7E /* SetUpLocationDrivenGeotriggers.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 000FFFB326CB043200E3CE7E /* SetUpLocationDrivenGeotriggers.storyboard */; };
000FFFB626CB044700E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 000FFFB526CB044700E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift */; };
000FFFB726CDD66B00E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift in CopyFiles */ = {isa = PBXBuildFile; fileRef = 000FFFB526CB044700E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift */; };
00166C8824D20E3C00DD317E /* RealisticLightingAndShadowsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00166C8724D20E3C00DD317E /* RealisticLightingAndShadowsViewController.swift */; };
00166C8A24D20E6E00DD317E /* RealisticLightingAndShadows.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 00166C8924D20E6E00DD317E /* RealisticLightingAndShadows.storyboard */; };
00166C8C24D236A300DD317E /* RealisticLightingAndShadowsViewController.swift in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00166C8724D20E3C00DD317E /* RealisticLightingAndShadowsViewController.swift */; };
Expand Down Expand Up @@ -938,6 +941,7 @@
dstPath = "";
dstSubfolderSpec = 7;
files = (
000FFFB726CDD66B00E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift in CopyFiles */,
0075033326B4B85700022C7B /* OrbitCameraAroundObjectViewController.swift in CopyFiles */,
0075033426B4B85700022C7B /* OrbitCameraSettingsViewController.swift in CopyFiles */,
00FFE6DD26606343001E92ED /* QueryWithCQLFiltersViewController.swift in CopyFiles */,
Expand Down Expand Up @@ -1226,6 +1230,8 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
000FFFB326CB043200E3CE7E /* SetUpLocationDrivenGeotriggers.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = SetUpLocationDrivenGeotriggers.storyboard; sourceTree = "<group>"; };
000FFFB526CB044700E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetUpLocationDrivenGeotriggersViewController.swift; sourceTree = "<group>"; };
00166C8724D20E3C00DD317E /* RealisticLightingAndShadowsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RealisticLightingAndShadowsViewController.swift; sourceTree = "<group>"; };
00166C8924D20E6E00DD317E /* RealisticLightingAndShadows.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = RealisticLightingAndShadows.storyboard; sourceTree = "<group>"; };
00166C9124D3838200DD317E /* BufferListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BufferListViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1863,6 +1869,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
000FFFB026CB040B00E3CE7E /* Set up location-driven geotriggers */ = {
isa = PBXGroup;
children = (
000FFFB326CB043200E3CE7E /* SetUpLocationDrivenGeotriggers.storyboard */,
000FFFB526CB044700E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift */,
);
path = "Set up location-driven geotriggers";
sourceTree = "<group>";
};
00166C8524D20E0E00DD317E /* Realistic lighting and shadows */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3109,6 +3124,7 @@
3ED027FD1B8E392500ACA70D /* Display information */ = {
isa = PBXGroup;
children = (
000FFFB026CB040B00E3CE7E /* Set up location-driven geotriggers */,
009B5FF525E58E0000BB9A77 /* Create symbol styles from web styles */,
F1F651A724984742006DF277 /* Show popup */,
00DAE5D924213D6B00D51281 /* Custom dictionary style */,
Expand Down Expand Up @@ -5021,6 +5037,7 @@
3E03F0991B056F9C0078EB36 /* highlight.pack.js in Resources */,
F1C81C4522FCEC1C00229CAA /* GetElevationPoint.storyboard in Resources */,
F4159C6B209257B50016E53D /* FeatureLayerRenderingModeMap.storyboard in Resources */,
000FFFB426CB043200E3CE7E /* SetUpLocationDrivenGeotriggers.storyboard in Resources */,
D97B7E591FD9BFE700E1239D /* Subdivisions.shx in Resources */,
D97B7E691FD9BFE700E1239D /* Subdivisions.shp.xml in Resources */,
00BA068525311B0D0039EF4D /* hydrography in Resources */,
Expand Down Expand Up @@ -5394,6 +5411,7 @@
00686FD02480889900EDA705 /* NavigateARNavigatorViewController.swift in Sources */,
3EFDE0F61E36ABB700CBCD92 /* FeatureCollectionLayerViewController.swift in Sources */,
3ED028FB1B8E3AA500ACA70D /* OnInteractionNoCacheViewController.swift in Sources */,
000FFFB626CB044700E3CE7E /* SetUpLocationDrivenGeotriggersViewController.swift in Sources */,
3E4BF4421C5AE98300D85919 /* FindAddressViewController.swift in Sources */,
092A1C2A22456D9500C5F230 /* DisplayWFSViewController.swift in Sources */,
D930E01122EA47F7006C09A1 /* TraceUtilityNetworkViewController.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,14 @@
<key>storyboardName</key>
<string>CreateSymbolStylesFromWebStyles</string>
</dict>
<dict>
<key>displayName</key>
<string>Set up location-driven geotriggers</string>
<key>descriptionText</key>
<string>Create a notification every time a given location data source has entered and/or exited a set of features or graphics.</string>
<key>storyboardName</key>
<string>SetUpLocationDrivenGeotriggers</string>
</dict>
</array>
</dict>
<dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Set up location-driven geotriggers

Create a notification every time a given location data source has entered and/or exited a set of features or graphics.

![Geotriggers](set-up-location-driven-geotriggers-1.png)
![Geotriggers](set-up-location-driven-geotriggers-2.png)

## Use case

Geotriggers can be used to notify users when they have entered or exited a geofence by monitoring a given set of features or graphics. They could be used to display contextual information to museum visitors about nearby exhibits, notify hikers when they have wandered off their desired trail, notify dispatchers when service workers arrive at a scene, or more.

## How to use the sample

Observe a virtual walking tour of the Santa Barbara Botanic Garden. Information about the user's current Garden Section, as well as information about nearby points of interest within 10 meters will display or be removed from the UI when the user enters or exits the buffer of each feature.

## How it works

1. Create an `AGSLocationGeotriggerFeed` with an `AGSSimulatedLocationDataSource`.
2. Create an `AGSFeatureFenceParameters` from an `AGSServiceFeatureTable`, a buffer distance at which to monitor each feature, an Arcade Expression, and a name for the specific geotrigger.
3. Create an `AGSFenceGeotrigger` with the geotrigger feed, an `AGSFenceRuleType`, and the fence parameters.
4. Create an `AGSGeotriggerMonitor` with the fence geotrigger and call `start(completion:)` method to begin observing for notifications that meet the `AGSFenceRuleType`.
5. When a notification is posted, capture the `AGSFenceGeotriggerNotificationInfo`.
6. For more information about the feature that triggered the notification, access the `fenceGeoElement` property of the `AGSFenceGeotriggerNotificationInfo`.
7. Depending on the `AGSFenceNotificationType`, update information on the UI from the geo-element's attributes.

## Relevant API

* AGSArcadeExpression
* AGSFeatureFenceParameters
* AGSFenceGeotrigger
* AGSFenceGeotriggerNotificationInfo
* AGSFenceRuleType
* AGSGeoElement
* AGSGeotriggerMonitor
* AGSGeotriggerNotificationInfoKey
* AGSLocationGeotriggerFeed
* AGSServiceFeatureTable
* AGSSimulatedLocationDataSource

## About the data

This sample uses the [Santa Barbara Botanic Garden Geotriggers Sample](https://arcgis.com/home/item.html?id=6ab0e91dc39e478cae4f408e1a36a308) ArcGIS Online Web Map which includes a geo-referenced map of the garden as well as select polygon and point features to denote garden sections and points of interest. Description text and attachment images in the feature layers were provided by the Santa Barbara Botanic Garden and more information can be found on the [Garden Sections & Displays](https://www.sbbg.org/explore-garden/garden-sections-displays) portion of their website. All assets are used with permission from the Santa Barbara Botanic Garden. For more information, visit the [Santa Barbara Botanic Garden](https://www.sbbg.org) website.

## Tags

alert, arcade, fence, geofence, geotrigger, location, navigation, notification, notify, routing, trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"category": "Display information",
"description": "Create a notification every time a given location data source has entered and/or exited a set of features or graphics.",
"ignore": false,
"images": [
"set-up-location-driven-geotriggers-1.png",
"set-up-location-driven-geotriggers-2.png"
],
"keywords": [
"alert",
"arcade",
"fence",
"geofence",
"geotrigger",
"location",
"navigation",
"notification",
"notify",
"routing",
"trigger",
"AGSArcadeExpression",
"AGSFeatureFenceParameters",
"AGSFenceGeotrigger",
"AGSFenceGeotriggerNotificationInfo",
"AGSFenceRuleType",
"AGSGeoElement",
"AGSGeotriggerMonitor",
"AGSGeotriggerNotificationInfoKey",
"AGSLocationGeotriggerFeed",
"AGSServiceFeatureTable",
"AGSSimulatedLocationDataSource"
],
"redirect_from": [],
"relevant_apis": [
"AGSArcadeExpression",
"AGSFeatureFenceParameters",
"AGSFenceGeotrigger",
"AGSFenceGeotriggerNotificationInfo",
"AGSFenceRuleType",
"AGSGeoElement",
"AGSGeotriggerMonitor",
"AGSGeotriggerNotificationInfoKey",
"AGSLocationGeotriggerFeed",
"AGSServiceFeatureTable",
"AGSSimulatedLocationDataSource"
],
"snippets": [
"SetUpLocationDrivenGeotriggersViewController.swift"
],
"title": "Set up location-driven geotriggers"
}
Loading

0 comments on commit 28b7a41

Please sign in to comment.