[OpenLayers-Users] maxExtent has no properties
Stephen Woodbridge
woodbri at swoodbridge.com
Wed May 30 21:47:55 EDT 2007
Tom wrote:
> 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:
I ran into this error the other night and found that I had forgotten to set:
map.addOptions({isBaseLayer: true});
which seemed to solve the problem.
-Steve W.
> ...
> 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
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list