[OpenLayers-Users] noob question: zoomToExtent() confusion

Phil Scadden p.scadden at gns.cri.nz
Wed Jun 8 23:07:43 EDT 2011


Google maps uses spherical mercator. Define lat/long and Spherical 
Mercator projection objects: viz
var p4326 = new OpenLayers.Projection("EPSG:4326");
var p900913 = new OpenLayers.Projection("EPSG:900913");
  Create your bounds, then
bounds.transform(p4326,p900913).
map.zoomToExtent(bounds);

-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.



More information about the Users mailing list