gpt4 book ai didi

google-maps - Google Maps API v2 不适用于 Firefox 和 IE

转载 作者:行者123 更新时间:2023-12-04 05:14:05 25 4
gpt4 key购买 nike

我正在尝试在我的网站中使用 google maps v2,但是该 map 没有出现在 firefox 中,即它出现在 chrome 中。我找不到问题,有谁知道代码中的问题是什么? map 可以在http://www.ideiah.com/contato查看。

代码:

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=AIzaSyAPPKVsGOmTcBlOo_FkNi4QBn19RKBPMeI" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function MyIndexOf(arr, element)
{

for(i = 0; i < arr.length; i++)
{
if( arr[i] == element)
return i;
}
return -1;

}
//]]>
</script>

<script type="text/javascript">
//<![CDATA[
//mapGDynamicMap2
function GetMapIndex(map)
{
var currentMapType = map.getCurrentMapType();
return MyIndexOf(map.getMapTypes(),currentMapType);
}

function SetMapIndex(map,mapTypeIndex)
{
map.setMapType(map.getMapTypes()[mapTypeIndex]);
}


function LoadMapmapGDynamicMap2(){
var mapGDynamicMap2 = new GMap2(document.getElementById("GDynamicMap2"));
mapGDynamicMap2.setCenter(new GLatLng(-29.789195,-55.768093), 17);
mapGDynamicMap2.setMapType(mapGDynamicMap2.getMapTypes()[2]);
SetMapIndex(mapGDynamicMap2,0);
mapGDynamicMap2.addControl(new GMenuMapTypeControl());
mapGDynamicMap2.addControl(new GSmallMapControl());
mapGDynamicMap2.addControl(new GOverviewMapControl());

var pointGDynamicMarker7141266 = new GLatLng(-29.789241,-55.768329);
var GDynamicMarker7141266 = new GMarker(pointGDynamicMarker7141266, {icon:G_DEFAULT_ICON, draggable: false});
GDynamicMarker7141266.bindInfoWindowHtml('Ideiah Soluções em Software');
mapGDynamicMap2.addOverlay(GDynamicMarker7141266);

GEvent.addListener(mapGDynamicMap2, "zoomend", function(){document.getElementById("mapGDynamicMap2ZoomLevel").value=mapGDynamicMap2.getZoom();;
});
GEvent.addListener(mapGDynamicMap2, "moveend", function(){document.getElementById("mapGDynamicMap2Center").value=mapGDynamicMap2.getCenter().toUrlValue();;
});
GEvent.addListener(mapGDynamicMap2, "maptypechanged", function(){document.getElementById("mapGDynamicMap2MapType").value=GetMapIndex(mapGDynamicMap2);;
});
}
//]]>
</script>

<div>
<span id="mapGDynamicMap2ZoomLevel" value="17"></span>
<span id="mapGDynamicMap2Center" value="-29.789195,-55.768093" ></span>
<span id="mapGDynamicMap2MapType" value="0" ></span>
</div>
<div class="GMPdiv img-polaroid" style="width:90% !important; margin: 0 auto;">
<div id="GDynamicMap2" class="GMPmap" style="width:100%;height:200px;"></div>
</div>
<script type="text/javascript">
//<![CDATA[
LoadMapmapGDynamicMap2();//]]>
</script>

最佳答案

这是一个 CSS 问题,由设置 max-width:100% 强制为 imgstyle.css

将此附加到 style.css:

#GDynamicMap2 img{max-width:none !important}

关于google-maps - Google Maps API v2 不适用于 Firefox 和 IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14514618/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com