[OpenLayers-Trac] [OpenLayers] #3248: Feature disappears after transforming a vertex (point) on Mobile Safari (iPhone)

OpenLayers trac-20090302 at openlayers.org
Tue Apr 5 12:55:04 EDT 2011


#3248: Feature disappears after transforming a vertex (point) on Mobile Safari
(iPhone)
----------------------------+-----------------------------------------------
 Reporter:  calvinx         |       Owner:  tschaub     
     Type:  bug             |      Status:  new         
 Priority:  minor           |   Milestone:  2.11 Release
Component:  Geometry.Point  |     Version:  SVN         
 Keywords:                  |       State:              
----------------------------+-----------------------------------------------
 A polygon feature which is drawn by the user on mobile safari disappears
 if we implement the transform method on the polygon vertices inside the
 callback for the "featureadded" event.

 If we clone the vertices before we call the transform method, the polygon
 feature works as expected. This is probably a minor bug.

 // this is the event listener
  polygonLayer.events.on({ "featuremodified": polygonSave, "featureadded":
 polygonSave })

 //

 function polygonSave(data) {
   var mapProjection = map.getProjectionObject()
   var nodes = data.feature.geometry.getVertices();
   for (var j=0; j<nodes.length; j++) {
    // writing "var newPoint = nodes[j].clone().transform(mapProjection,
 defaultProjection);" fixes it
 var newPoint = nodes[j].transform(mapProjection, defaultProjection);

    // bla bla bla... rest of my function goes here but it doesnt matter.
   }

 }

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3248>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list