What's the point of 'meta viewport user-scalable=no' in the Google Maps API

后端 未结 4 945
陌清茗
陌清茗 2020-12-04 08:13

I\'m using the Google Maps JavaScript API V3 and the official examples always have you include this meta tag:



        
4条回答
  •  一整个雨季
    2020-12-04 08:52

    On many devices (such as the iPhone), it prevents the user from using the browser's zoom. If you have a map and the browser does the zooming, then the user will see a big ol' pixelated image with huge pixelated labels. The idea is that the user should use the zooming provided by Google Maps. Not sure about any interaction with your plugin, but that's what it's there for.

    More recently, as @ehfeng notes in his answer, Chrome for Android (and perhaps others) have taken advantage of the fact that there's no native browser zooming on pages with a viewport tag set like that. This allows them to get rid of the dreaded 300ms delay on touch events that the browser takes to wait and see if your single touch will end up being a double touch. (Think "single click" and "double click".) However, when this question was originally asked (in 2011), this wasn't true in any mobile browser. It's just added awesomeness that fortuitously arose more recently.

提交回复
热议问题