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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -