Skip to content Skip to sidebar Skip to footer

Google Map Won't Show In Phonegap Ios App

I have an PhoneGap iOS app and have this HTML that won't show the map in the app. I see the map perfectly in Safari or FF but not in the app. How can I get this to work? <

Solution 1:

PhoneGap has a whitelist system for external URLs/Hosts.

From the wiki:

Also, the latest code has the new white-list feature. If you are referencing external hosts, you will have to add the host in PhoneGap.plist under the "ExternalHosts" key. Wildcards are ok. So if you are connecting to "http://phonegap.com", you have to add "phonegap.com" to the list (or use the wildcard "*.phonegap.com" which will match subdomains as well).

Your code snippet above has a few external hosts in it:

  • maps.google.com
  • code.jquery.com

Perhaps try adding "*" to ExternalHosts to start with to make sure that isn't the problem, then add more specific hosts once it's working.

Solution 2:

You have to Add everything Google Maps wants to load to the external hosts list. I added the following and it works fine for me:

  • *.google.com
  • *.googleapis.com
  • *.gstatic.com

Solution 3:

I had the same problem with the hosts, but your the "*.googleapis.com" solution worked. But the map still didn't appear because I hadn't an API key and this solved my problem. Hope it helps you because in your code you don't have an API key.

Post a Comment for "Google Map Won't Show In Phonegap Ios App"