[OpenLayers-Users] 512 image scaling problems
Gary Townsend (Spatial Mapping Ltd.)
garyt at spatialmapping.com
Wed Jul 26 17:44:13 CDT 2006
Thank you that worked I didn't think it was the mapserver parameters but I
wanted to give as much information as I could.
-----Original Message-----
From: Christopher Schmidt [mailto:crschmidt at crschmidt.net]
Sent: July 26, 2006 2:57 PM
To: Gary Townsend (Spatial Mapping Ltd.)
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] 512 image scaling problems
On Wed, Jul 26, 2006 at 02:38:11PM -0700, Gary Townsend (Spatial Mapping
Ltd.) wrote:
> I am trying to rework my search page at
http://www.resmap.com/imgsearch3.asp
> I am having a problem with image scaling though I would like to use an
image
> with a width of 750 I have my default image size in mapserver set for
> 750x750 I have the map tag defined within the web page as
The Mapserver image size is unrelated to OpenLayers -- OpenLayers sets
the image size via WMS request parameters.
> #map {
> width: 750px;
> height: 750px;
> border: 1px solid black;
> }
>
> However when the web page loads the image is no where near the full size
of
> the map box. If I double the map to 1024x1024 voila it fills the whole
box.
> When I use a zoom level of 1.5 in the setCenter it fills the map box but
the
> drag functions of the box are off center. The following is my init script:
The problem is that the full extent of the map at zoom level 1 does not
fit in a box of width 750. (zoomToFullExtent() is designed to zoom to
the closest zoom which fits the whole map.)
If you want to always have the map fill the window, you can add a
{'maxResolution': 'auto'} to your map constructor:
var map = new OpenLayers.Map('map', {'maxResolution':'auto'});
This should achieve the effect you're looking for. If not, please feel
free to explain how we can assist you further.
--
Christopher Schmidt
Web Developer
More information about the Users
mailing list