5 Replies Latest reply on Feb 4, 2011 2:45 PM by KenKing

    Making a smaller Google Map

    new2FM

      Title

      Making a smaller Google Map

      Post

      Hi:

      I'm really new to all this so hope you'll bear with me...:-)

      I am entering in a database of sites for an upcoming retreat. I will eventually post it on the web for the atendees to review. I am trying to create a small google map, one that just has the locale pinpointed and the zoom-in/zoom-out bars enabled. I don't want the address bubble. I don't want all the google menu text.

      I read the FMPro forum posts on customizing Google Maps. I tried the tips on the following post, but could not get it to work. (I don't quite understand where to insert the info, since mine is not an address written into the container, it is taken from the form...)

      http://forums.filemaker.com/posts/f24b854d9f

      Here's what my map coding text (is this called a script?) looks like...

      "http://maps.google.com/maps?" & "q=" & /*Address=*/ cabindetails::address1 & "," & /*City=*/ "" & "," & /*State=*/ "" & "," & /*Zip Code=*/ cabindetails::zip_code & "," & /*Country=*/""

      At the small size I want (roughly 4" x 4" square) all you see it the big title "Google Map" and some menu items. You can't even see the map...

      I'd love any help you could offer. Once on the web, I want the user to be able to see the general location, and be able to zoom in and out. That's it.

      If the answer involves coding (I'm sure it will), please try to be very specific, since I'm not very techy.

      Thanks SO MUCH!

        • 1. Re: Making a smaller Google Map
          KenKing

          This post is old, but still relevant, so I'll try to answer it. 

          First, you'll need to define a custom function (not sure if all FM flavors custom functions, but FM Advanced does).

          Here's a link to a site that has a function almost exactly to your specifications (nothing but the map, and the zoom/direction/map buttons): http://www.briandunning.com/cf/1085

          You'll see that the HTTP code has a placeholder for "address" "city" "zip" and "zoom".  You will need to replace those terms with a function (e.g, getfield) in order to pull the info entered by the user (or you can hardkey if you want a static map).

          After that, set up a web viewer on your layout (name it "web"), choose "custom web address", then hit specify, then select the custom function you created.  Thats it. 

          If you need to change the appearance of the map (from plain map to satelite imagery, for example) let me know and i'll post the relevant code for you. 

          Ken

          • 2. Re: Making a smaller Google Map
            philmodjunk

            I'm not sure why you need a custom function for this?

            Zoom can be one more field referenced in the URL code and thus a simple script/button that modifies the zoom setting can be specified.

            I use: z=14 to set the zoom level to 14 in one  of my solutions. If I wanted to set the zoom via script, I'd just refer to a field here instead of the literal value 14.

            • 3. Re: Making a smaller Google Map
              KenKing

              Phil, Good point, you dont need a custom function.  All you really need to do is put the url directly into the web address box in the Web Viewer Setup.

              Not sure what utility defining as a custom function adds, other than ease of portability?  

              Also a good point about incorporating more fields, instead of hardkeys, to add more flexibility for the user. 

              - Ken

              • 4. Re: Making a smaller Google Map
                philmodjunk

                Instead of a field, this can be a reference to a global variable also.

                • 5. Re: Making a smaller Google Map
                  KenKing

                  Phil, 

                  yet another good point. So many ways to do things in FM...

                  Here's a challenge (for me) I haven't yet started yet (bc bc I imagine it will be heavily reliant on url code/googlemaps API and I dont know a whole lot about it). Maybe you can throw some pointers my way: 

                  Start a loop to grab each address (of e.g., apartment buildings) from my records, put the data in a $stack, set up a web viewer to call google maps, map each address, use the GPS feature of googlemaps to show my current location on the same map, exclude from the map all properties that are not X miles from me.  

                  Any ideas on how to make that as easy as possible?  

                  Ken