Some sort of reusage of already used locations has been addressed earlier. First step would be to make the user interface better, using autocomplete to fill in certain fields. Duplicate, or more usage of one particular coordinate should be avoided, but having autocomplete on cities, countries would certainly improve the interface as users assign multiple locations to one city, country.
Here is a patch to Drupal 5 that implements basic autocomplete function for the "city" textfield. Further option to extend it to other fields via the $ltype variable in the function.
Further plans: apply this to country selection, I will open a new issue on that.
Comment | File | Size | Author |
---|---|---|---|
#38 | location-137405-10297877.patch | 4.96 KB | max-kuzomko |
#35 | location-137405-10052530.patch | 5 KB | max-kuzomko |
#30 | location_city_autocomplete-137405.patch | 9.08 KB | kaizerking |
#27 | location_city_autocomplete-137405.patch | 9.25 KB | kaizerking |
#22 | location_city_autocomplete-137405-22.patch | 4.62 KB | lchang |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedmarked #139761: Prepopulate Cities? as a duplicate of this request.
Comment #2
YesCT CreditAttribution: YesCT commentedtagging
Comment #3
juicytoo CreditAttribution: juicytoo commentedI would like to contribute $20 towards this feature.
Is there a donate button anyway on the project page?
Comment #4
ankur CreditAttribution: ankur commentedSounds like a nice feature, but something very specific. There're also a lot of open details, such as how do you compose a list of auto-complete cities for different locales? For some countries, this could be through the use of country/province values already entered while for others just country. This probably needs to be thought out and then evaluated for whether we have the resources make this happen.
Comment #5
ellocin CreditAttribution: ellocin commentedHello,
Here is a patch for autocomplete city in Location 7.x-3.x-dev. I don't know if someone would be interested by this patch....
I came to drupal/php few month ago so please let me know if this patch (my first !) needs to be improved.
best regards,
Comment #6
kaizerking CreditAttribution: kaizerking commented#5 This patch cannot be applied
The patch cannot be applied in current context
Is any one having a solution for this?
Comment #7
jordiserra CreditAttribution: jordiserra commentedAny news on this subject? I am very interested in autocomplete for cities. If I can help in some way, module admin please tell me!
Comment #8
kaizerking CreditAttribution: kaizerking commented#5 ellocin can you please re-do this patch, there is lot of difference in current version hence. even to apply manually I can't find the code where to put to put this.
Comment #9
jordiserra CreditAttribution: jordiserra commentedI applied the #5 patch manually and it works for my project. I think the dropdown can be easily included also.
I can't verify it always works, but at least it does with user locations. It should be included in the module, because if you want to classify content by city, you can't do it if the user enters the city name, there always will be mistakes and inconsistences.
I don't know if it is very difficult, but with no doubt it would be very useful.
Comment #10
YesCT CreditAttribution: YesCT commented@jordiserra if you applied the code manually, can you do a diff, and post that so it can be used as a newer patch?
Comment #11
osysltd CreditAttribution: osysltd commentedSubscribing. Please post a patch to stable version.
Comment #12
laraz CreditAttribution: laraz commentedI need this patch to the verisio 7.x-3.0-alpha6.
thanks.
Comment #13
podarokbot?
Comment #14
podarok#5: location_city_autocomplete.patch queued for re-testing.
Comment #16
podarok#5 needs reroll against latest 3.x dev
Comment #17
kaizerking CreditAttribution: kaizerking commentedHere is the patch that applies to 7.x-3.x-dev
Comment #18
podarokbot
Comment #19
podaroklot of whitespace and indentation error
http://drupal.org/coding-standards#indenting
\ No newline at end of file
http://drupal.org/coding-standards#comment-5262644
Should be fixed before RTBC
Comment #20
podarokdue to #19
Comment #21
dancor CreditAttribution: dancor commentedbump
is the autocomplete working? I see there a location_autocomplete.js file, can I use this and how can I use this?
Comment #22
lchang CreditAttribution: lchang commentedFixed whitespace and indentation error in kaizerking's patch.
Comment #26
lchang CreditAttribution: lchang commented"Location Google Geocoder tests(broken!!!)" can be passed after applied the patch in issue 2406483.
Comment #27
kaizerking CreditAttribution: kaizerking commentedremoved the coding standard issues
Comment #28
kaizerking CreditAttribution: kaizerking commentedComment #29
podarokPlease, follow drupal coding standards. https://www.drupal.org/coding-standards#indenting
We should use white spaces instead of tabs.
we should avoid of using commented code
Comment #30
kaizerking CreditAttribution: kaizerking commentedOk done
Comment #31
kaizerking CreditAttribution: kaizerking commentedComment #32
podarok@return shoud have empty line before
function should have docblock
remove whitespaces, according to Drupal coding standards
'=' should have spaces around it
remove whitespaces, please
There are a lot of issues with code style. Need fix.
Comment #33
max-kuzomko CreditAttribution: max-kuzomko at Smartweb commentedComment #34
max-kuzomko CreditAttribution: max-kuzomko at Smartweb commentedComment #35
max-kuzomko CreditAttribution: max-kuzomko at Smartweb commentedFix #32
Comment #36
max-kuzomko CreditAttribution: max-kuzomko at Smartweb commentedComment #38
max-kuzomko CreditAttribution: max-kuzomko at Smartweb commentedFix #35
Comment #39
max-kuzomko CreditAttribution: max-kuzomko at Smartweb commentedComment #40
Valentine94Looks good, let's RTBC
Comment #42
podarokthanks, merged
Comment #44
Kristina Katalinic CreditAttribution: Kristina Katalinic as a volunteer and at Webmar commentedHello,
can anyone please explain how I use this feature? Because, when I type in first couple of letters of any Australian city nothing is being autocompleted and I can't find a settings form where I can add a list of cities that should be available on autocomplete form.
Thanks in advance
Comment #45
Kristina Katalinic CreditAttribution: Kristina Katalinic as a volunteer and at Webmar commentedOk, I figured it out, zipcodes need to be imported into the database and then it works ok.
However, using autocomplete user is able to input a "fictional" location that does not actually exist and is basically identical problem as originally described when issue was first created as we can end up with Locations that don't actually exist. Based on my experiences with building directory type websites there is also a slight "issues" with any of the cities from database showing up regardless of the state/province that was previously selected so we can end up with a city of Sydney in state of Queensland even though it only exists in the state of New South Wales...
Perhaps put a permission on the field so user can only pick cities already in database and cannot add a new city or, provide a select option instead of autocomplete? Either way would prevent the user from entering a location that is not already recorded in the database so perhaps adding a "select" option would be more practical as it would add on to the feature.
Comment #46
Agiss CreditAttribution: Agiss as a volunteer and commentedHi guys,
We have started working on a patch for cities and postal code autocomplete for Location version 7.x-3.7.
Please have a look at https://www.drupal.org/node/2712081#comment-11129657
Hope this helps
Cheers
Agis
Comment #47
ydahiI came here searching for an autocomplete solution for Location field exposed filters for views (in my case the field I wanted this functionality was: city). Went searching and found a fully functionally solution here:
https://www.drupal.org/project/views_autocomplete_filters