- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi i have some problems with google maps embed on Iframe i use like 10 on my app on the preview they work fine also in the emulator but when i build the apk and try on my phone sometimes they din't apear and there is just a blank space others they are not well centered some advised to fix that?
<style>
.wrapper {
position: relative;
padding-bottom: 165%; // This is the aspect ratio
height: 0;
overflow: hidden;
}
.wrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 93% !important;
}
</style>
<div id="mapa_2" class="upage-content vertical-col left hidden">
<div class="wrapper">
<iframe src="http://mapbuildr.com/frame/hc0v2v" frameborder="0"></iframe>
</div>
</div>
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some old android devices dont initialize height and width immediately, try loading map after Cordova deviceready event is fired, here is sample code I tested, this loads the iframe src after deviceready event is fired:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <style> .wrapper { position: relative; padding-bottom: 165%; // This is the aspect ratio height: 0; overflow: hidden; } .wrapper iframe { position: absolute; top: 0; left: 0; width: 100% !important; height: 93% !important; } </style> <script src="cordova.js"></script> <script> document.addEventListener("deviceready", function(){ document.getElementById("map").src = "http://mapbuildr.com/frame/hc0v2v"; }, false); </script> </head> <body> <div id="mapa_2" class="upage-content vertical-col left hidden"> <div class="wrapper"> <iframe id="map" src="" frameborder="0"></iframe> </div> </div> </body> </html>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ty so much at least in emulate works fine now i have to edit for other maps on the apk and try on my phone =)

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