Latitude, Longitude, and Special Formulas
These are some special tips and instructions for working with latitude, longitude, and distance formulas.
Last updated
These are some special tips and instructions for working with latitude, longitude, and distance formulas.
Last updated
Skill Level: Intermediate
Ensure you have generated your Google API Key
Know about the location property type and location magic text
You will need a paid Adalo plan to use this feature.
Note that each time your app requests user location, your Google plan may be charged.
With latitude and longitude, you can also format the way the coordinates are displayed to your end user, by clicking on the pencil icon in the red Magic Text bubble whenever latitude and longitude is displayed in an input. Decimal is the default formatting.
You can obtain much better Maps component performance, by setting the marker address to be a lattitude and longitude value rather than an address. This is because the address is already broken down into its most basic elements and does not have to be sent to Google twice to determine the marker's location on the map. Set the markers values as Location Latitude,Location Longitude as seen below:
You can also combine latitude and longitude data with custom formulas to calculate the distance between two points in either kilometers or miles using two new functions.
Miles Calculation - MILES(latA, lonA, latB, lonB)
Kilometer Calculation - KILOMETERS(latA, lonA, latB, lonB)
You can setup your formula to calculate the distance between two points like so:
As always, you can add suffixes and prefixes to your custom formulas to have them say miles, kilometers, etc.
You can also put additional parentheses around the distance calculation in formulas and multiply or divide it to get different distance denominations such as feet, meters, and others.
Check out our course in the App Academy about using Location.
If you need additional help with this article, you can always ask in our community forum! Be sure to paste the link to this article in your post as well!