OpenLayers 2 - How to manually change coordinates of point?

793 Views Asked by At

Is there any way to edit coordinates of the point manually? I want to edit a point just like I create:

var point = new OpenLayers.Geometry.Point(newX,newY);
var point_ft = new OpenLayers.Feature.Vector(point, null, null);
warstwaRysowania.addFeatures(point_ft);

Can I do it similar to this example? If yes please tell me how. I want to work on the existing feature.

1

There are 1 best solutions below

0
Robert On

Ok, I got a solution:

 function(e) {
            console.log(e.feature.geometry);
            var newPoint = new OpenLayers.LonLat(myX, myY);
            e.feature.move(newPoint);
            }