开发者

Page zoomed on iPad with Google maps

开发者 https://www.devze.com 2023-03-04 05:54 出处:网络
I am working on a webb app for iPad that uses Google maps v3.5 api and have run across a problem. I suspect that it is a bug in the api but I\'m hoping to get it confirmed here before I drop it.

I am working on a webb app for iPad that uses Google maps v3.5 api and have run across a problem. I suspect that it is a bug in the api but I'm hoping to get it confirmed here before I drop it. Loading the page in landscape or portrait mode works with out a hitch but if I change from potrait to landscape the buttons in the top right cornor gets pushed outside of the screen. It looks to me as if the resolution of the screen isn't changed. Sort of like the page it self is zoomed in.

I'm unfortunately not allowed share the webadress but has anyone else come across this beavior before? And is there a soloution?

Know it's hard with only snippets but... this is from the header to stop the user from any funny buisness:

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

开发者_JAVA百科And this is from the body where the map will reside.

<div id="map_canvas" style="width: 100%; height: 100%"></div>

And this is from the javscript that displays the map:

var myLatlng = new google.maps.LatLng(56.668142,16.341105);
// Start settings for the map
var myOptions = {
  zoom: 13,
  center: myLatlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
};
// Creating and displaying the map
map = new google.maps.Map(document.getElementById("map_canvas"),
    myOptions);

I have been able to repdroduce the error with only this call to google api in regards to displaying anything on the web page.


Try using this meta tag instead:

<meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
0

精彩评论

暂无评论...
验证码 换一张
取 消