Logicify / jquery-locationpicker-plugin

JQuery Location Picker plugin
MIT License
389 stars 260 forks source link

Location not accurate #122

Open GauthamArumugam opened 7 years ago

GauthamArumugam commented 7 years ago

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

AVargas89 commented 7 years ago

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

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

AVargas89 commented 7 years ago

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]; },

e-zola commented 3 years ago

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