[mapserver-users] Openayers - Map zoomed in to much

Paul Curran paul_everton at hotmail.com
Wed Jul 22 03:55:18 EDT 2009



Hi,

I am having trouble viewing my map correctly via open layers, the map is zoomed in very close I cannot zoom out anymore. 

I have tried different zoom extents however it is the same. Can anyone tell me where I am going wrong is it the epsg code? If I enter a different epsg code I just see the background colour of my map file.

Andy help greatly appreciated

My map and openlayers files are below

Thanks

 

 

MAP



NAME UK1

PROJECTION

"init=epsg:4326"

END 

SIZE 1600 1200

IMAGECOLOR 153 204 255

IMAGETYPE JPEG

SHAPEPATH "http://localhost/openlayers/data/"

EXTENT -8883850.321101 -310000.000000 15483850.321101 12710000.000000

UNITS METERS





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' "wms demo"

'wcs_onlineresource' "http://127.0.0.1./cgi-bin/mapserv?map=/ms4w/apps/openlayers-2.5/data/uk1.map&"

'wms_srs' "epsg:4326 epsg:4269"

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

END

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>MAPPING TEST

<style type="text/css">

#map {

width: 90%;

height: 90%;

border: 8px solid black;

}

</style>

<script src="../lib/OpenLayers.js"></script>

<script type="text/javascript">

var zoom = 1;

var bounds = new OpenLayers.Bounds(-888385.321101, -31000.000000, 1548385.321101, 1271000.000000); 

var map, layer;



function init(){

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

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);

map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 



}

</script>

</head>

<body onload="init()">

<div id="map"></div>

</body>

</html>

_________________________________________________________________
Share your memories online with anyone you want.
http://clk.atdmt.com/UKM/go/134665338/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090722/5e76efb4/attachment.html


More information about the mapserver-users mailing list