[英]Google Maps navigation controls distorted/wiggling in IE11
这个问题与我在这里问过的另一个问题有很大的关系 : Google Maps API v3.19在Internet Explorer Quirks模式中断开 。 在试图找到针对该问题的修复程序时, Pointy建议进行更改,这为我提供了一个可用的地图,但该建议引发了左上角的Google地图导航控件的另一个问题。 当我在IE11中拖动地图时,导航控制“摆动”并且看起来很奇怪。 问题也发生在之前的(冻结的)谷歌地图版本3.18上,因此似乎是另一个问题,而不是我提到的另一个问题,因此我在这个问题中提出了这个问题。
此页面演示了IE11中的问题。 Chrome和Firefox工作正常:
<!DOCTYPE html>
<head>
<title>Google Maps Test Page</title>
</head>
<body style="margin:0; padding:0">
<script src='http://maps.googleapis.com/maps/api/js?v=3.18' type='text/javascript'></script>
<script type='text/javascript'>
function initialize() {
top.google.maps.visualRefresh=true;
var mapOptions = {
zoom: 13,
center: new google.maps.LatLng(51.5072, 0.1275),
mapTypeId: google.maps.MapTypeId.ROADMAP,
scaleControl: true,
overviewMapControl: true
};
this._map = new google.maps.Map(document.getElementById('myMap'), mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="myMap" style="width:500px;height:500px;position:relative;"></div>
</body>
</html>
我无法在任何其他版本的Internet Explorer中测试这个,但问题在IE11中非常明显。 有谁知道如何克服这个显示问题?
我在一段时间后也遇到过这个问题,经过各种论坛的狩猎后发现以下样式更改解决了这个问题,至少在我的情况下是这样:
<script>
var doc = document.documentElement;
doc.setAttribute('data-useragent', navigator.userAgent);
</script>
<style type="text/css">
html[data-useragent*='Trident/7.0'] div[title^="Zoom"]
{
opacity: 0 !important;
}
html[data-useragent*='Trident/7.0'] div[title^="Pan"]
{
opacity: 0 !important;
}
</style>
尝试一下,看看它是否有帮助,我希望它确实如此,我现在已经太好了,这造成了多少痛苦以及花费在寻找工作解决方案上的时间!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.