角谷歌地图窗口关闭按钮漂移

时间:2014-12-22 21:27:54

标签: angularjs angular-ui onsen-ui angular-google-maps

我们在使用Onsen和angular-google-maps方面的应用。如示例here中所示," x"在Google地图中,每次重新加载地图时,InfoWindow都会慢慢漂移。

地图上的所有窗口都打开&#34; x&#34;在第一次相同,正确,位置。关闭地图页popPage()并打开地图pushPage()会导致&#34; x&#34;漂移到正确的8px。生成以下内容?并放在我放在<ui-gmap-window>标签中的内容下方的DOM中。

<div style="width: 19.5px; height: 19.5px; overflow: hidden; position: absolute; opacity: 0.7; transform: translateZ(0px); right: 15px; top: 12px; z-index: 10000;">
    <img src="http://maps.gstatic.com/mapfiles/api-3/images/mapcnt3.png" draggable="false" style="position: absolute; left: -3px; top: -504px; width: 88.5px; height: 738px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;">
</div>

返回并重新打开:

<div style="width: 19.5px; height: 19.5px; overflow: hidden; position: absolute; opacity: 0.7; transform: translateZ(0px); right: 7px; top: 4px; z-index: 10000;">
    <img src="http://maps.gstatic.com/mapfiles/api-3/images/mapcnt3.png" draggable="false" style="position: absolute; left: -3px; top: -504px; width: 88.5px; height: 738px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;">
</div>

如何确定造成这种漂移的原因?

更新 2015-01-22:

我目前有一个解决方法。

function fixInfoWindow(){
    $timeout(function(){
        $(".gm-style-iw").each(function(){
            if(this.parentNode.style.visibility != "hidden" && this.nextSibling != null){
                this.nextSibling.style.right = "10px";
                this.nextSibling.style.top = "8px";
                this.nextSibling.nextSibling.style.right = "3px";
                this.nextSibling.nextSibling.style.top = "1px";
            }
        });
    });
}

这会移动&#34; x&#34;以及在按下正确位置时关闭窗口的隐藏项目。我在设置每个InfoWindow的函数末尾调用此函数。

我的example也可以在Chrome中重现设备仿真功能。

我还没有找到漂移的原因。

0 个答案:

没有答案