Google maps Google Map div,由容器div隐藏
我有一个div,其中包含一个#map div,用于显示谷歌地图 我遇到的问题是,我无法以任何方式与地图交互,因为它被封装它的div“隐藏” 我如何避免这种情况Google maps Google Map div,由容器div隐藏,google-maps,Google Maps,我有一个div,其中包含一个#map div,用于显示谷歌地图 我遇到的问题是,我无法以任何方式与地图交互,因为它被封装它的div“隐藏” 我如何避免这种情况 <div id="container"> <!-- This div is 'on top' of the map, therefore I cannot access it/invoke click events on it. --> <div id="map">
<div id="container">
<!-- This div is 'on top' of the map, therefore I
cannot access it/invoke click events on it. -->
<div id="map">
<!-- This is where the map is loaded -->
</div>
<div id="description">
</div>
</div>
谢谢。如果您在map div的css中放置一个
位置:relative
,然后将该div的z-index
设置为高于容器的z-index
的任何数字,您应该能够与map交互
如果在div隐藏的情况下生成地图,请使用
google.maps.event.trigger(map,“resize”)
触发地图的resize事件,其中map
是包含google地图对象的JS变量。当包含它时,container
如何位于map
之上?