April 10, 2015 Blog FileMaker Modules FilemakerFileMaker MappingFileMaker ProfmMappingGeocodingGoogle Maps Geocoding and Mapping Module for FileMaker Pro Geocoding for FileMaker Pro We’ve had several projects that needed some basic mapping functions for FileMaker Go on iPad. For one reason or another, we never really made anything that was easily replicable. Realizing that we were going to need to do this again, we wanted to find a pre-made module. Our aim was to have a simple way to take a group of addresses and create a map using the Google API in FileMaker. We specifically wanted the plugin to be straightforward. Nothing fancy – just simple, elegant, and (ideally) ready-to-go out of the box. Google Maps for FileMaker Figuring (or perhaps hoping) there was somebody in the FileMaker community who had already done this and put it up online, I went looking for something we could borrow code and ideas from. I downloaded a variety of different demo files from forums here and there, but didn’t find anything satisfactory for our purposes. The best example I found was from a DevCon presentation in 2012 by Thomas Kunetz. Among the files included in the download was one that did exactly what we needed. This download contained a few inefficiencies and was tailored for a presentation. All of the field and language settings were in French, and it took a while for us to reverse engineer a few parts of it. However, it had some of the best and simplest code we could build from. fmMapping by AppWorks Starting with that, we built a new file from scratch and adapted the Google API code a bit. We rewrote all the scripts for our purposes, while also using some features from FileMaker 13 (specifically, geocoding addresses on server instead of locally). We built it to be easy to plug into an existing FileMaker solution, distilling it down to only the essential components. Extra code was added specifically to avoid the need to add new summary or global fields. Now we had a nice simple module that we could install in future projects. Since we recognized there was need for just such a module in the FileMaker community, we decided we’d release it. We did so under a Creative Commons license for free. FileMaker Mapping Download Enjoy! (Perhaps this goes without saying, but AppWorks makes no warranty, express or implied, for its performance/suitability for a given task.) By David Weiner
6 Comments Craig Watson Posted on 5:10 PM - December 6, 2016 Thanks so Much for this- I hooked in in my app and it works great. I do have a question. Did you experiment with changing the colors of the markers in the Generate new map script – Let ( [ LATLONG = “new google.maps.LatLng(” & $lat & “,” & $long & “)” ; LOCATION = Substitute ( GetAsCSS ( $description & “¶” & $address & “¶” & $city & ” ” & $zip & “¶” & $state & “¶” & $country ) ; “\”” ; “‘” ) ; MARKER = “{\”position\”:” & LATLONG & “, \”info\”: \”” & LOCATION & “\”}” ] ; Case ( $lat and $long ; MARKER ; “” ) ) I have tried icon : -Then the color maker, but haven’t got it to work. Any suggestions? David Weiner Posted on 10:47 AM - December 7, 2016 I did play around with it a bit, but we decided to release it in its basic form without, since we had no need for multi-colored markers at that point. Take a look in the javascript that is set in the “Set Field [Geolocation_Globals::gHTML]” step in the “Generate New Map” script. In the javascript line that sets the var marker, you can add a different icon by changing the line to: var marker = new google.maps.Marker({map:map,icon:’http://maps.google.com/mapfiles/ms/icons/green-dot.png’}); I believe you can also choose a custom web-located icon, instead of a Google provided one. It gets a bit more complicated if you want to specify different icons for different record types, as it involves re-writing some of the javascript, but it’s definitely possible. Good luck! Abbas Basui Posted on 4:03 PM - February 11, 2017 Thanks you for that, is it possible to add a link in the infoWindow to go to related record or execute a script David Weiner Posted on 9:25 AM - February 13, 2017 Yes, it’s possible, but we haven’t ever tried it. We’re contemplating a version 2 of the geocoding module, so that’s something we might look into in future. Jens Posted on 10:18 AM - June 11, 2019 Is there anybody who succesfully added a link in the infowindow to the related record? David Weiner Posted on 11:08 AM - June 11, 2019 Yes, we’ve had a client that did it himself, and we’ve done it for a client ourselves. It involves using the fmp: protocol in a URL. You can use it to run a script that navigates to the record using an ID passed in as a parameter.