- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I use Intel XDK's geolocation sample.I set all build settings and api key then deploy my phone.But when index.html run app crashed.
How can I set map?
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems to be a bug with Windows Phone and/or Google Maps. I recommend making sure you are using the latest version of google maps API script.
Consider trying some of these samples provided directly by Google Maps as well at https://developers.google.com/maps/documentation/javascript/examples/#basics.
Also, make sure you have the appropriate URLs if you are not using * (which allows your app to access all URLs) under the Project Tab > Build Settings > Whitelist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Elroy
My code is
<html>
<head>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="scripts/platformOverrides.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.17&sensor=false"></script>
<script>
function initialize() {
var mapProp = {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"), mapProp);
}
</script>
</head>
<body>
<div id="googleMap" style="width:500px;height:380px;"></div>
</body>
</html>
I added whitelist
<access origin="*.google.com" />
<access origin="*.googleapis.com" />
<access origin="*.gstatic.com" />
<access origin="*.googleusercontent.com" />
<access origin="google.com" subdomains="true"/>
<access origin="googleapis.com" subdomains="true"/>
<access origin="gstatic.com" subdomains="true"/>
<access origin="googleusercontent.com" subdomains="true"/>
<access origin="http://maps.google.com" subdomains="true"/>
<access origin="http://*.google.com" subdomains="true"/>
<access origin="*" />
When run the app,the exception is Can’t load <http://maps.google.com/maps/api/js?v=3.17&sensor=false>.
can’t load remote web content in the local context.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try adding this script to your app, see the readme for details > https://github.com/xmnboy/xdk-win8x-compat.js <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Paul,
I fixed my problem with use this sample.
http://www.creepyed.com/2012/11/how-to-use-the-google-maps-api-on-windows-8/
I don't know this is correct way but map problem was solved.
I change iframe src like this
ondeviceready(){
var lat = getDataInSession('lat');
var long = getDataInSession('long');
var url = ms-appx-web:///www/map.html?lat=lat&long=long
$('#Map').attr(src,url);
}
and then parse the url in the map.js and set lat and long values.
Thank you for your helps.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page