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: [email protected]
> To: [email protected]
> 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
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
                                          
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to