[OpenLayers-Dev] Fill up the most available space in the div tag by wms map

Eric Lemoine eric.c2c at gmail.com
Tue Jun 24 17:33:41 EDT 2008


2008/6/23 Darko Radiceski <radiceski at gmail.com>:
> Dear all,
>
> I am experiencing the following issue....
>
> I load a map from WMS. And then i call map.zoomToMaxExtent()
>
> That zooms out to full extent but what i have noticed it does not fill up to
> the most available space in the div tag. The div tag for the map is of
> absolute size.
>
> So for example if the div tag is 400 x 400 , when i zoom to maxExtent the
> WMS map i get is like 300 x 300 and is centered in the div. I would like the
> map to fill the full 400 x 400 with the 180 and -180 being right at the edge
> of the div.
>
> Is is possible to specify on initial load for the map to be zoomed to full
> extent but also fill up the most real eastate possible?

By default OL requests tiles that are 256 x 256. So only one tile fits
in a 400 x 400 div. Either make your div for example 512 px width and
256 px height, or change the tile size by overriding the constants
OpenLayers.Map.TILE_WIDTH and TILE_HEIGHT.

Hope that helps,

--
Eric



More information about the Dev mailing list