Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Getting the lat ang long base on the address

Featured Replies

What's the process of getting lat and lon base on the address entered to filemaker.

Find a friendly geocoding API and get it from there. 

In the past I used Google Maps for this, but now they require a billing account even for the free tiers.

 

  • Author
10 minutes ago, comment said:

Find a friendly geocoding API and get it from there. 

In the past I used Google Maps for this, but now they require a billing account even for the free tiers.

 

I have a free API key using google maps but i don't know how pull the lat and long from there.

If they didn't change it, then you have two options: import an XML response, or get a JSON response and parse it.

I suggest you try the JSON route first: for testing, define a global text field, then use the Insert From URL script step to place the response in this field. The URL needs to be calculated from your address fields - something like:

"http://maps.googleapis.com/maps/api/geocode/json?address="
&
Substitute ( List ( Street ; City ; State ; Country ) ; [ " " ; "+" ] ; [ ¶ ; "+" ] ) 
&
"&key=YOUR_API_KEY"

This should populate the global field with a JSON response like the one shown here.

 

Then you can parse out the latitude using:

JSONGetElement ( YourTable::gTestfield ; "results[0]geometry.location.lat" )

and, of course, for longitude change the last key to "lon".

 

Once you have it all working, you can replace the global test field with a script variable.

---
Caveat: the response may contain more than one address; you should test for this and, if necessary, let the user select the correct one.

 

 

Edited by comment

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.