javascript - Openlayers - coordinates saving after drag cause point go to 0,0 -
i have map dragable point , after drag, update latitude , longitude fields in form. when this:
drag = new openlayers.control.dragfeature(vectors, { autoactivate: true, oncomplete: function() { $('#place_latitude').val(point.transform(mapp, wgs84).y); return $('#place_longitude').val(point.transform(mapp, wgs84).x); } });
after attempt make second drag (from 1 point another) point goes 0,0. without oncomplete
ok.
you transforming point
2 times... transform
method modifies point
itself, doesn't create new object.
you may use point.clone()
instead of point
.
Comments
Post a Comment