This blog introduces Trek2There, a new mobile app from Esri Labs just published to the Google Play and iTunes app stores. Esri Labs projects are developed by Esri employees and are inspired by our interactions with ArcGIS users like you.
Esri Labs projects are free to use but are not official Esri products. These projects do not go through the rigorous software development cycle so they are not holistically tested, documented or supported by Esri technical support. Despite all of these, you may find Trek2There not just awesome, but also pretty useful!
You can think of this app as a smart compass that will always point to your destination. Unlike an ordinary compass, pointing to magnetic North, this app will use your direction of travel to tell you in what direction you should go to reach your destination.
Trek2There is particularly helpful when you are trying to find a location in an area where driving directions would not cut it. Say for example, you want to find a point of interest in a forested area with no trails. Say you are trying to find an archeological site, a pond or an asset for which you only know its geographic coordinates.
Trek2There only requires two things to work:
- First, the destination where you want to go provided in geographic coordinates (Latitude/Longitude).
- Second, it requires you to be outside and moving so your device can fix your location and determine your direction of travel.
Let’s first try the app and then I will explain details of how to make it work with your own apps.
Trek2There, a first quick test
Start by downloading Trek2There onto your Android or iOS device. You need to feed the app with the coordinates of your destination, these can be typed in manually or more typically are sent from a separate application. For now, we will use a simple web-based app. On your device, launch this web app and tap on the map to select your destination. As you tap you will see a new dialog open from which you can launch Trek2There.
Now that the app is running, start walking in any direction and shortly the arrow will rotate to show you the direction and distance to your destination. Walking with caution and avoiding physical obstacles is all on you!
Trek2There custom URL scheme
Using the app is straight-forward as you can see. Launching it and passing the coordinates of your destination is what takes some thought but do not worry, it is not complicated at all. Trek2There can be launched remotely by invoking this custom URL scheme:
If you copy the above string and paste it into a browser on your device, you will be able to launch Trek2There and set its destination at the provided latitude and longitude. You could send this URL as a link in an email, or programmatically invoke this URL from a custom developed application.
Launching native apps like Trek2There through a custom URL scheme -also often referred to as a deep-link- works fairly well across all platforms when you invoke the URL from a custom native application. If you invoke the app from a web browser it will work as expected on Windows, iOS and Mac. On Android you may find issues launching the URL scheme from some mail clients and the Chrome browser.
Working with Trek2There’s custom URL scheme from your own apps
If you build your own applications with AppStudio for ArcGIS, you can of course launch Trek2There as well.
The source code of Trek2There is shared under the Apache 2.0 License, so if you like you can take this app and make it your own. May be you want to embed this functionality within your own app, or re-brand Trek2There… your choice!
You can find the source code at https://github.com/Esri/Trek2There.
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
The easiest way to download the source code is by using AppStudio for ArcGIS Desktop Edition. Once installed, click on New App and search for Trek2There under the Enterprise category. You can look at the code, modify it and run it in your Mac or Windows development machine. If you have an AppStudio for ArcGIS Standard license, then you will be able to compile your code for Windows, Mac, iOS, Android and Ubuntu Linux.