我只是需要把一个DIV(或更多)中或上的地图,像地图区域内的菜单DIV,谷歌地图V2内或在地图
我需要当我加载我的地图这个div是存在的...
css不能做到这样对不对?
该div包含PHP代码...
我只是需要把一个DIV(或更多)中或上的地图,像地图区域内的菜单DIV,谷歌地图V2内或在地图
我需要当我加载我的地图这个div是存在的...
css不能做到这样对不对?
该div包含PHP代码...
是的,这很容易与CSS定位来完成。考虑下面的简单的例子:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps v2 API: Floating Div</title>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false"
type="text/javascript"></script>
</head>
<body onunload="GUnload()">
<div style="position: relative;">
<div id="map_canvas" style="width: 400px; height: 300px;"></div>
<div style="position: absolute; top: 0px;
width: 100px; height: 100px; background-color: grey;">
Menu Here
</div>
</div>
<script type="text/javascript">
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(38.00, -100.00), 3);
</script>
</body>
</html>
截图:
谢谢,它非常适合我! – TiagoMartins 2010-07-12 00:50:43
这为我工作的谷歌地图API3。
其中我的菜单下拉元素现在以正确的顺序覆盖Google Maps API3。
这是重要的CSS代码:
.menudropdown {
position: fixed;
z-index:2;
}
#map {
position: absolute;
z-index:1;
}
你想对你的菜单股利消失,一旦地图推出?还是你想让它在地图上浮动? – 2010-07-12 00:12:06
我需要div浮动, 谢谢 – TiagoMartins 2010-07-12 00:17:10