Cordoba windows 8 application: download external javascript (google maps)

I have a cordova app for iOS, and now I have to create it for Windows. The problem I am facing is that the application has Google Maps, but when I run it, I get this error:

google undefined

And in the console, I find this:

Application cannot load remote web content in local context

It seems to me that the problem is related to loading an external resource.
So how can I solve this?
Is there a way to load external resources in Windows 8 applications?

Any help is much appreciated! thank!

+4
source share
2 answers

I ran into the same problem. I found this solution to download google map in app.

The writer uses an iFrame to display the map:

default.html

...
<body>
    <iframe id="Map" src="ms-appx-web:///map.html" style="width:100%;height:100%;"></iframe>
</body>

map.html

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script
        src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&signed_in=true">
    </script>
        ...

I don’t need to include a map, but you want to use the Google Place Library in my existing view model.

I hope this solution solves your problem.

+1
source

whether the application works on iOS or a problem on both platforms.

Have you added a script for google maps like

<script src="http://maps.googleapis.com/maps/api/js key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"></script>

and resolve the script URL in the configuration file as

<access origin="*">

for all external links

-1
source

All Articles