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

Location not accurate

Open GauthamArumugam opened this issue 8 years ago • 3 comments

Cant able to get accurate location, I'm searching a location '6328 Tucker Drive San Jose, CA, United States' but i get the resulted address as '6377 Tucker Dr San Jose, CA, United States.

new

GauthamArumugam avatar Sep 01 '17 08:09 GauthamArumugam

I have the exact same issue and it's driving me crazy!

Can you please explain why the searching address changes by itself???

AVargas89 avatar Sep 02 '17 05:09 AVargas89

I found a temporary fix. Find in the .js addressByFormat: function (addresses, format) { var result = null; for(var i = addresses.length - 1; i >= 0; i--){ if(addresses[i].types.indexOf(format) >= 0){ result = addresses[i]; } } return result || addresses[0]; },

and delete "result||" so that it just returns the 1st address it finds in the callback array as the plugin search returns a few places in a small radius area :)

replace with:

addressByFormat: function (addresses, format) { var result = null; for(var i = addresses.length - 1; i >= 0; i--){ if(addresses[i].types.indexOf(format) >= 0){ result = addresses[i]; } } return addresses[0]; },

AVargas89 avatar Sep 02 '17 09:09 AVargas89

I still have the same issue after I used the temporary fix that @xexclusiv3x provided...

e-zola avatar Oct 07 '20 08:10 e-zola