November 15, 20196 yr What's the process of getting lat and lon base on the address entered to filemaker.
November 15, 20196 yr 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.
November 15, 20196 yr 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.
November 15, 20196 yr 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 November 15, 20196 yr by comment
Create an account or sign in to comment