Ticket #3248 (new bug)

Opened 2 years ago

Feature disappears after transforming a vertex (point) on Mobile Safari (iPhone)

Reported by: calvinx Owned by: tschaub
Priority: minor Milestone: 2.13 Release
Component: Geometry.Point Version: SVN
Keywords: Cc:
State:

Description

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.

}

}

Note: See TracTickets for help on using tickets.