[OpenLayers-Trac] Re: [OpenLayers] #3603: Problem with Geometry.Point.clone and proj4js "transformed" property

OpenLayers trac-20090302 at openlayers.org
Mon Jan 9 06:24:51 EST 2012


#3603: Problem with Geometry.Point.clone and proj4js "transformed" property
----------------------------+-----------------------------------------------
 Reporter:  milosh          |       Owner:  tschaub     
     Type:  bug             |      Status:  new         
 Priority:  major           |   Milestone:  2.12 Release
Component:  Geometry.Point  |     Version:  2.11        
 Keywords:                  |       State:              
----------------------------+-----------------------------------------------

Comment(by milosh):

 sorry for the bad formatting, I've overlooked tripple braces

 {{{

 var p = new OpenLayers.Geometry.Point(1, 1);
 var from = new OpenLayers.Projection("EPSG:900913");
 var to = new OpenLayers.Projection("WGS84");

 p.transform(from, to);

 // proj4js will set p.transformed = true;
 console.log(p.transformed == true);

 // now try to clone the geometry and reproject back p_new = p.clone();
 // applyDefaults called within clone will duplicate the "transformed" bit
 console.log(p_new.transformed == true);

 // when proj4js will find the "transformed" attr
 // it will do nothing

 transformed_p = p_new.transform(to, from);

 console.log(transformed_p == null);
 }}}

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3603#comment:1>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list