[OpenLayers-Users] Openlayers + Mapserver ZOOM problem

Christopher Schmidt crschmidt at metacarta.com
Fri May 8 16:20:39 EDT 2009


On Fri, May 08, 2009 at 04:04:03PM -0400, cole gillespie wrote:
> hi,
> 
> I have a real issue with one of my postgis map files loading into open
> layers. I have included a link to an HTML file that explains my problem.
> 
> http://www.colegillespie.com/OLissue.html

1. Stop using Layer.MapServer. You're honly hurting yourself here.
Instead, make your MapServer a WMS by adding:

  metadata 
    wms_srs "epsg:32119 epsg:4326"
  end

To your 'web' section of your mapfile, then change Layer.MapServer to
Layer.WMS. (No other changes are needed.)

2. What projection do you want to work in: 4326, or 32119? Make a
decision, then make your extents in that projection. Currently, they're
in 4326.

3. For now, set your maxResolution to 'auto'. This will automatically
make the map extents fit the window.

4. The maxResolution should be approximately equal to the width
   of your maxExtent in map units, divided by the width of your map
   display div. So, for example, a -180 -> 180 map is 360 degrees.
   dividing by 256, you get 1.40625. So for a lat/lon map, resolution
   defaults to that value. For you, you'll want something different if
   you want to go projected.

The HTML page you put together was comprehensive. I appreciate it. It's
only because you were so thorough that I was able ot quickly determine
your problem :)

Best Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list