Adalo Resources
Ask or search…
⌃K
Links

Latitude, Longitude, and Special Formulas

These are some special tips and instructions for working with latitude, longitude, and distance formulas.
Skill Level: Intermediate

Before You Begin

Walkthrough

Simple

Formatting

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.

Use with the Maps Component

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:

Using Distance Formulas

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:

Learn More

  • 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.

Help

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!