[OpenLayers-Users] Problem with restrictedExtent

Gery . gamejihou at hotmail.com
Wed Jul 18 04:29:22 PDT 2012




you need to set the transform explicitly, it worked for me, something like this:

var proj = new OpenLayers.Projection("EPSG:4326");
var point = new OpenLayers.LonLat(-71, 42);
map.setCenter(point.transform(proj, map.getProjectionObject()));

check here for more info: http://docs.openlayers.org/library/spherical_mercator.html

Hope this helps,















__________________________________________________________________________________________
Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO es necesario.
Think green - keep it on the screen. Do NOT print if it is NOT necessary.
Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie NICHT, wenn es NICHT notwendig ist.


> Date: Wed, 18 Jul 2012 04:02:02 -0700
> From: coffi at hotmail.co.uk
> To: openlayers-users at lists.osgeo.org
> Subject: [OpenLayers-Users] Problem with restrictedExtent
> 
> hI,
> Not sure what I am doing wrong but when I try to restrict extent by
> coordinates by British national grid (shown in code) or google mercator the
> extent is centred of west coast of africa rather than a uk city. Relevant
> code is shown below and any tips would be greatly appreciated.  
> 
> 
> 
> Gary
> 
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Problem-with-restrictedExtent-tp4989031.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120718/3d925df8/attachment-0001.html>


More information about the Users mailing list