6 Replies Latest reply on Jun 11, 2013 11:12 AM by mikebeargie

    Mapping Address When Connected via Cellular

    timgr

      Is there a problem getting a map using Google Maps and address fields from a Go database when the iOS device is connected via cellular? I have tried using the Contacts starter solution and this works perfectly when the iOS device is connected via wi-fi but does not provide a map if the iOS device is connected via the cellular network (with wi-fi turned off).

       

      Any ideas?

        • 1. Re: Mapping Address When Connected via Cellular
          mikebeargie

          Are the addresses also being pulled via cellular? Or is the address data stored local on the iOS device?

           

          What DOES the webviewer show? just blank? incomplete maps page?

           

          How long are you letting it "run" before giving up?

          • 2. Re: Mapping Address When Connected via Cellular
            timgr

            Mike, I am using the Contacts Starter Solution as supplied in FMPro 12. The address fields are part of the database. The map image shows an icon (red cross over a stylised map as well as a 'speed' gauge) when on cellular but will show the Goolge map for the address when connected via WiFi. The icon seems to imply that it can't display the map because of some speed issue but I am using 4G LTE which tests at 25Mbps whilst my wifi is good for only 10Mbps.

             

            On Wifi

            photo 1.jpg

             

            On cellular

            photo 2.jpg

            • 3. Re: Mapping Address When Connected via Cellular
              mikebeargie

              ok, I looked at the starter solution.

               

              The webviewer uses a "GetMap()" custom function. I'm not sure but it sounds like it's detecting non-wifi connections and not allowing you to load via this method.

               

              I would suggest changing the webviewer to the built in webviewer google maps link, then calculating based on your address fields. re-deploy to iOS and see if that works.

               

              You might want to do this on a duplicated layout just in case it does not work.

               

              Or you can use native iOS maps using this method:

              http://help.filemaker.com/app/answers/detail/a_id/9387/kw/already%20added%20maps

              • 4. Re: Mapping Address When Connected via Cellular
                timgr

                Thanks Mike for pointing me in the right direction. I looked at the customer function GetMap and noted that it was using the Goole Maps API. Checking the syntax I came across the following:

                 

                The Google Static Maps API has the following usage limits:

                • 25 000 free static map requests per application per day.

                Additional image requests can be purchased on a per application basis at the rate currently listed in the FAQ. Additional quota is purchased through the API Console and requires the use of an API key.

                If a user exceeds these limits, the server will return an HTTP 403 status and display the below image to indicate that the quota has been exceeded:

                So when I am on WiFi I can have 25K map request per day (which is reasonable as my IP is static and I don't run my FMPro app all that often). However, when I go to cellular I get a dynamic IP from my provider and the combined API requests must be too many and hence Google returns the HTTP 403 status.

                 

                Looks like I may need to modify GetMaps to include an API key.

                • 5. Re: Mapping Address When Connected via Cellular
                  databuzz

                  I just turned off Wi-Fi, opened the Contacts starter solution and was able to view a map successfully so there's definitely no issue with mapping when connected via 3G:

                   

                  IMG_1114.PNG

                   

                  Do some research into the map icon with the red X - it might be an issue with the Google Maps API and the number of queries allowed in a time frame (the icon with the red X has to have been downloaded as well from somewhere . . . )

                   

                  HTH,

                  Andrew

                   

                  FileMaker 12/11/10/9/8 Certified Developer

                  Databuzz

                  - - - - - - - - - - - - - - - - -

                  Phone: +61 2 9484 6565

                  Mobile: +61 418 468 103

                  Email: andrew@databuzz.com.au

                  http://www.databuzz.com.au

                  • 6. Re: Mapping Address When Connected via Cellular
                    mikebeargie

                    Looks like Tim figured it out just before you posted this. I didn't even think about the query limit, but it makes sense now. I'll keep that in mind if this pops up in the future.