We are excited to announce the release of a new sample app – Nearby – available today in AppStudio for ArcGIS! This sample showcases how to find the nearest places of interest worldwide, filter them by category, and provide step-by-step directions from your current location. Give this new app a spin using the AppStudio Player (readily available to run in the Samples tab) on your favorite mobile phone or tablet.
The source code for this sample app is available for you to inspect and customize further in AppStudio Desktop (4.0 and above) along with all the other great sample apps. Just open Desktop, click on the New App button, and either browse or type Nearby in the search box to find the sample and click Create.
On start, the app finds generic places of interests (ten at the most), such as restaurants and libraries, which are located within a 20-mile radius of the device’s location. The user is then presented with a list of found places sorted by distance.
Selecting any of these places from the list will highlight the location on a map and show the place’s details, and an option to view routing directions from the device’s to the location. Moreover, as the places are also shown on the map, the user is able to select any place on the map to view detailed information and routing directions to the selected place.
When the user taps on “Directions”, a route to the selected place is shown on the map as well as turn-by-turn directions. By default, the sample shows driving directions, and we added an option to switch between walking and driving directions as shown in the graphic below.
The sample demonstrates the power of Esri’s Geocoding Service by providing an intuitive experience for searching nearby places by names, addresses, or categories. The user can search by taping on a category as shown below, and they will be presented with up to ten nearby places matching the selected category.
The sample also allows the user to search by typing a name or an address. As the user types, a list of suggestions based on the user’s input and the device’s location will be shown for the user to choose from. When a user confirms their search input or chooses from the suggestions, places matching their selection will be shown as a list and as points on the map.
Accessing the device’s location and network
The release of AppStudio 4.0 brought great new additions including the PermissionDialog QML component, and we incorporated it in the sample to make sure the user grants location access permission to the app. This ensures that the app can access the device’s location in order to show nearby places of interest, and when the location access permission has not been granted, it will notify the user and request them to allow access.
Additionally, since we are using online geocoding and routing services, we need to make sure that the device has an active internet connection for the app to function. Thus, we added a check for network access that will notify the user to turn on an internet connection in case the connection is lost or is not available.
This sample app is built with ArcGIS Runtime, uses Google Material Design for the user interface, and is powered by Esri’s world Geocoding service to find places of interest such as restaurants, hotels, libraries, etc. If you are interested in the technical details and project structure of this sample app, please read this blog from AppStudio GeoNet to learn more.
We would like to thank Tresor Cyubahiro, one of our amazing summer interns, who helped us with this sample app.
- Please let us know your feedback and suggestions by emailing email@example.com or leave your comment on the GeoNet blog.
- New to AppStudio? Check out this website to learn more about what AppStudio for ArcGIS can do to you and your organization.
- Become an AppStudio for ArcGIS developer! Watch this video on how to sign up for a free trial.
- Follow us on Twitter @AppStudioArcGIS to keep up-to-date on the latest information and let us know about your creations built using AppStudio to be featured in the AppStudio Showcase.
- The AppStudio team periodically hosts workshops and webinars; please sign up for the AppStudio newsletter if you are interested in information regarding AppStudio events.