top of page

Learning Series: Using Maps and Other Geospatial Power App Features

Writer's picture: RedCloud ConsultingRedCloud Consulting

Getting the most out of Geospatial Power App Features with the help of Bing Maps and the wonders of U.S. National Parks!

As developers, we always get excited when we work with certain capabilities and features during a project. Maps, routing, and geospatial features are certainly one of those!


Believe it or not, Power Apps has a robust set of built-in features that allow for working with and visualizing location data such as addresses and coordinates. Here is a fun example of geospatial Power App features based on U.S. National Parks. And if you’re really interested, a copy of the app is available below.


 

About the App


This simple Power App has a few very cool features baked into it, which we’ll discuss in more detail below. But put yourself in this situation: You have a desperate desire to get outside and see nature and realize that you spent $85 on an annual national parks pass that is going to expire in a month, so you need to get your money’s worth!



That’s where this app saves the day. Based on either your current location or a specific address, you can then see all national parks in order of how far they are from you! But perhaps you also want to see some specific type of natural wonder or filter down to a specific state. From there, just select the parks that you want to visit, and Power Apps will work with Bing Maps to automatically order the destinations using the most efficient route. From there, you can see how long of a journey you have ahead of you in terms of both miles and drive time.


Tying it to Business


Now, admittedly, the business value for most companies and users is low (hence why you can download the app for free below 😊). However, the same principles and geospatial features can be extremely valuable in other scenarios. For example:


  • Delivery routing and other supply chain logistics

  • Finding nearest locations

  • Field service optimization

  • Field data collection and inspections

  • Sales territory management

  • Facilities management

  • Real estate and property management

  • Environmental compliance


And guess what? Our team would love to help bring these capabilities to life for you!


Digging into Features


Sorting By Distance

You can use relatively simple math to sort coordinates by distance from a point. Unfortunately, there’s not an out-of-the-box feature in Power Apps, but with new, user-defined formulas and functions, we can make one ourselves!

DistanceBetweenCoordinates(Latitude1:Number, Longitude1:Number, Latitude2:Number, Longitude2:Number):Number =

    With(

        {

            earthRadius: 6371,

            radianFactor: (Pi() / 180)

        },

        (2  earthRadius) 

            Asin(Sqrt(0.5 - Cos((Latitude1 - Latitude2)  radianFactor)/2 + Cos(Latitude2  radianFactor) *

            Cos(Latitude1  radianFactor)  (1 - Cos((Longitude1 - Longitude2)  radianFactor)) / 2))  0.62137119

    );


By creating the function under the App’s Formulas, we can now use it everywhere in the app where we want to compare coordinates.


Bing Maps

With the Bing Maps component, you can quickly see how useful it can be if you’re running an operation that involves driving to multiple stops. As we did in the demo, multiple destinations were selected and entered into waypoints. Then, the map automatically optimized the route to find the best one. Even better, you get details for each leg of the journey, which is how we were able to aggregate to show the total time and distance.


Address Bar

The address input bar may be something we take for granted in our everyday lives due to the prevalence of Google or Apple Maps, but often, in the business world, you require entering address information for a customer, a store, or a delivery. The address bar greatly increases the user experience by validating/searching for the address as you type. From there, the street, city, state, and zip code information can be saved more reliably.



Hopefully, this fun demo inspires you to think of ways that the Power Platform’s geospatial features can make your organization run more efficiently. If you’re interested in trying the app yourself, the zip file is available below.



Of course, we’d like nothing more than to help you with your Power Platform needs. We’re flexible and easy to work with, so please reach out!



30 views0 comments

Kommentare


bottom of page