[OpenLayers-Users] can't get full sized map to share space

Hawk AA hawk at aamdal.com
Tue Jun 21 17:54:24 EDT 2011


Hi,

I think I've already written that code.

Please check out http://hakon.micado.no/hawkroads/ and the attached
stylesheet :) Happy scripting!
Hawk

-----Original Message-----
From: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Danny Shevitz
Sent: 21. juni 2011 23:33
To: openlayers-users at lists.osgeo.org
Subject: [OpenLayers-Users] can't get full sized map to share space

Howdy,

this is an OpenLayers/CSS newbie question. I am trying to get a full screen
map, just like the example code in the distribution. The wrinkle is that I
want a little fixed height content at the top and the map to fill the rest
of the page.
All browser window resizing is reflected in the map. Think of a menu bar at
the top of the page. For the life of me, I can't get this to work. 

I'm including source inline. I would expect this to work. If anyone could
point out how to get this to work, I'd sure appreciate it.

Thanks,
Danny


%< ---------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head><title>Mapping Application</title> <meta http-equiv="Content-Type"
content="text/html; charset=UTF-8"/> <style type="text/css"> html,body {
height:100%; width:100%; margin:0; } #top_content { position:absolute;
top:0; left:0;
margin: 0;
padding: 0;
bottom: 50;
width: 100%;
}
#map {
position:absolute;
top:50;
left:0;
margin: 0;
padding: 0;
bottom: 0;
width: 100%;
}
</style>
<script type="text/javascript" src="/static/openlayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
map = new OpenLayers.Map( 'map'); //
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer); map.setCenter(new OpenLayers.LonLat(0, 0),6); }
</script> </head> <body onload="init()"> <div id="container"> <div
id="top_content"> top content</div> <div id="map" ></div> </div> </body>
</html>


_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list