[OpenLayers-Users] OL Zoom Issue - Zoomed in very close, cannot not zoom out

Paul Curran paulcurran9 at googlemail.com
Tue Aug 18 09:43:00 EDT 2009


Hi,



Been struggling with this problem for a little while now any help
appreciated.



I can view my map of the UK fine via mapserver however when I view it via
Openlayers I am zoomed in very close to the map (tree level). I am able to
zoom in even closer (map becomes blurred) however i cannot zoom out. I only
have one layer in the map file.



For my bounds I am using the extent from my map file



Here is my code



      *var zoom = 10;*

      var bounds = new OpenLayers.Bounds(0, 0, 660046, 1229782);

      var map, layer;





      function init(){

      map = new OpenLayers.Map('map', { *maxExtent: bounds, numZoomlevels:
10* });

      map.addControl(new OpenLayers.Control.PanZoomBar());

      map.addControl(new OpenLayers.Control.OverviewMap());

      map.addControl(new OpenLayers.Control.MousePosition());

      layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",

      "http://127.0.0.1/cgi-bin/mapserv.exe?", { layers: 'uk', map:
'/ms4w/apps/openlayers-2.5/data/uk1.map' },

      { gutter: 15 });

      map.addLayer(layer);
      *map.zoomToExtent(bounds);*
**
Can anyone see where I am going wrong or have any suggestions?


Cheers, thanks for any help in advance

Paul

p.s.   My mapfile is here

MAP

    NAME UK1
 PROJECTION
    "init=epsg:4326"
 END
    SIZE 1600 1200
    IMAGECOLOR  153 204 255
    IMAGETYPE JPEG
    SHAPEPATH "http://localhost/openlayers/data/"
    EXTENT  0 0 660046 1229782
    UNITS DD


 WEB
   TEMPLATE "http://localhost/openlayers/examples/test.html"
   LOG "\ms4w\tmp\ms_tmp\log.txt"
      IMAGEPATH "\ms4w\tmp\ms_tmp\"
      IMAGEURL "/ms_tmp/"
      METADATA
  'wms_title' "map"
        'wms_onlineresource'  "http://127.0.0.1./cgi-bin/mapserv?map=uk1.map
"
      END
 END
  LAYER

    NAME "UK"
    METADATA
      'wms_title' "wms_demo"
    END
    STATUS DEFAULT
    TYPE raster
    TILEINDEX "map"
    TILEITEM "Location"
    PROJECTION
      "init=epsg:4326"
    END
    CLASS
      STYLE
       COLOR 0 0 0
      END
      LABEL
       COLOR 0 0 0
       SIZE SMALL
      END

    END

  END
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090818/a3271e09/attachment.html


More information about the Users mailing list