In this post submitted by Jeroen Aarts of Clickworks, Jeroen demonstrates using Open Street Maps as a Google Maps alternative…
As an alternative for the Google Maps API, you might consider using Open Street Maps (OSM). OSM has a very simple, clever geocoding service called Nominatim. Use FileMaker\’s Insert From URL script step, choose JSON as return format and parse latitude (lat) and longitude (lon).
As an example, have a look at the details from our Antwerp office: openstreetmap.org/search?
If you store the result in a variable $result, use these function calls in FileMaker to parse the latitude and longitude: Set Variable [ $lat ; Value: JSONGetElement ( \”lat\” ) ] Set Variable [ $lon ; Value: JSONGetElement ( \”lon\” ) ] Please be aware that the returned JSON object is actually an array which may consist of more than 1 element. In the above example we are parsing the lat and lon elements from the first array item – remember that the JSONGetElement() function is 0-based when querying arrays. The Usage Policy is much more flexible than that of the Google Maps API\’s. Of course, if you are using the OSM service, respect terms of service and copyright.
Reverse geocoding: getting a street addressYou can reverse geocode as well, that is, retrieving a street address from longitudes and latitudes. As an example, from this query:
openstreetmap.org/reverse? We get this result:
See more great FileMaker Blogs from our friends at ClickWorks!