Logicify / jquery-locationpicker-plugin

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

Which are addressFormat options / How to get just address formatted? #136

Open jonalxh opened 6 years ago

jonalxh commented 6 years ago

Hi again friends.

I'm trying to get just the address (streetName + streetNumber), not the full address with state/province, city and country. I've reviewed your demo page in the Advanced usage of geo decoder features and tried to use the addressComponents.addressLine1 feature, but it didn't work as expected, because the address is not being formatted well. If I check the code I find that $('#map').locationpicker('map').location.formattedAddress; does the trick in the full address field, but how to format just the addressLine?, look at the comparision:

1 - Full location field:

2 - Just addressLine1:

Notice in the second example the address is reversed and not being formatted. Please help me :( I think that with the addressFormat I could do something, but I just find that you suggest postal_code option, and in my case it's not useful (because my country don't use postal code).


By the other hand I'm trying to get the country separately in another field, but I just get the country code, in my case CO instead of Colombia, I wanna get both data, but how?

Thanks a lot, excuse my bad English.