jquery-locationpicker-plugin icon indicating copy to clipboard operation
jquery-locationpicker-plugin copied to clipboard

Setting location does not trigger onchanged event

Open VSpectrum opened this issue 8 years ago • 2 comments

Setting the location like

$('#map').locationpicker("location", {latitude: 10.64, longitude: -61.42});

does not trigger this onchanged function which can be used further on to set values such as street name, country and city.

This behaviour is not as intuitive or easily flexible as setting a location only calls updateInputValues which is not exposed - requiring editing in locationpicker.jquery.js. It should also be tied to the onchanged event.

A quick solution

that worked for me, was to just trigger the dragend event inserting

google.maps.event.trigger(gmapContext.marker, "dragend");

after updateInputValues when setting the position on line 318

VSpectrum avatar Oct 31 '16 13:10 VSpectrum

I have a smiliar issue, but this does not do the trick for me :(

Maybe you can help me on this problem. I described it in detail here: Stackoverflow

JRsz avatar Nov 02 '16 11:11 JRsz

+1

sahilchopra avatar Feb 14 '17 10:02 sahilchopra