- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm working with Intel XDK and Ionic as framework the problem that i have is i'm trying to use google map and when i load the apk in the emulator and on real device the map display grey and i have to rotate the screen and then the map display as normal with the marker and controllers.
<div id="map" style="height: 60vh"></div>
<script>
var map;
function initMap() {
var myLatLng = {lat: -39.83250715421206, lng: -73.23938548564911};
// Create a map object and specify the DOM element for display.
var map = new google.maps.Map(document.getElementById('map'), {
center: myLatLng,
scrollwheel: false,
zoom: 15
});
// Create a marker and set its position.
var marker = new google.maps.Marker({
map: map,
position: myLatLng,
title: 'Banco de Sangre'
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDl1lpx2C8RmatmhG__vBcmtjEsEPjUVbo&&callback=initMap" async="" defer=""></script>
I Try ionic.Platform.ready(function(){
but then that map load in blank.
- Tags:
- HTML5
- Intel® XDK
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What calls initMap()?
Is it possible that the div itself (or any of its parents) is not displayed when initMap() is called? Google Maps won't work if the div is display:none;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so i have to add something on the div to init the map when it loads?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page