[OpenLayers-Users] maxExtent has no properties

Tom tom at ukbassline.co.uk
Wed May 30 10:16:44 EDT 2007


Hi all,

I'm currently trying to get the co-ordinates of the origin of the map in
order to utilise the geoserver meta tiler extension to WMS see:
http://docs.codehaus.org/display/GEOSDOC/WMS+vendor+parameters  These
co-ordinates must be included in the WMS URL so I'm doing the following:

...
var map;
function init()
{
var options = {resolutions:[72,36,18,9.6,4.8,2.4,1.2,0.6,0.3,0.15,0.125],maxExtent:new
OpenLayers.Bounds
(0,0,2000000,2000000),maxResolution:'auto',units:'meters',projection:'EPSG:27700',controls:[]};
map = new OpenLayers.Map( $('map'), options );
map.setCenter(new OpenLayers.LonLat(543443,255213), 7);
var olextent = map.getExtent();
var origincoords=toString(olextent.bottom) + ',' + toString(olextent.left);
...

and I'm getting the following error:

maxExtent has no properties
isValidLonLat(lon=543443,lat=255213 lon=543443 lat=255213
CLASS_NAME=OpenLayers.LonLat
)Map.js (line 933)
setCenter( lon=543443,lat=255213 lon=543443 lat=255213 CLASS_NAME=
OpenLayers.LonLat , 7, undefined, undefined)Map.js (line 804)
init() classexample.php (line 11)
onload(load ) classexample.php (line 1)
valid = maxExtent.containsLonLat(lonlat);

Any ideas?

cheers,

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070530/d678a140/attachment.html


More information about the Users mailing list