| Project: | Location |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi All,
A few months ago, I had hired a developer to implement the following functionality for location module
1) geocoding
2) reverse geocoding
3) automatic taxonomy term creation
Though a lot of the work was completed, there are still some issues which stop these accompanying modules to work on a prodution website. I had hoped that I will release it after the module was completely finished, however, like any well thought out plan, this one has got derailed.
I am releasing this code into the community in the hope that module maintainers will like it and it will get integrated into the main location module itself thus making life easy for me.
Please note that this module is still not production worthy and needs thorough testing
To install and get this to work
1) replace the core autocomplete.js file with the attached autocomplete.js file
2) Enable accompanying Location module, geocoding as well as Event Taxonomy modules
3) Create a new vocab called geocoding (you can call it whatever you like)
4) go to admin/seetings/geocoding and in select taxonomy - choose the vocab created in step 3 above
5) select the node types where you want the location modules to be enabled
You are all set now
in the admin/contet/types - for each content type ..make sure min and max location is selected as 1
use case
Lets say page node type has the geocoding enabled
You go to node/add/page
fill in the title body etc
fill in the location fields and press get address ...location fields will populate with the right information through google maps geocoding
if you click on the map..corresponding information will get updated into the location fields using reverse geocoding
and when you save the node...taxonomy terms will be created for the corresponding values in the location fields
Hope this helps others
Manuj
Comments
#1
I tried attaching the files but as they were bigger than 1 MB..there was an issue
So here is the dropbox link from where you can get the files
http://dl.dropbox.com/u/1484709/Location_new.zip
#2
I isolated the changes to Location itself. An added hook to alter the location element. It seems reasonable enough, although there may be alternative ways to accomplish this.
I diffed against DRUPAL-6--3 with datespec "2009/03/04 00:00:00".
#3
And here's a repackaged zipfile with location taken out.
#4
* Code seems to be pretty average custom code. Doesn't conform to the coding style standards but that's easily fixable.
* greversegeocoder.js is not gplv2, upstream is http://code.google.com/p/greversegeocoder/ (so can't commit directly to cvs but can provide a pointer for users to download)
* Code bypasses location's apis somewhat.
* Hey, um, in geocoding_get_existing_address_id(), where you are deleting other addresses with matching information, shouldn't you be updating the rows in {location_instance} that were pointing to the stuff you're deleting? That looks like a data-loss bug to me...
#5
Hi Bdragon
Thanks for looking into the attachments
The developer who wrote the code wasnt too familiar with location module as well as geomapping etc hence there might be the issues with bypassing apis etc. However to his credit he did manage to write the code which more or less does what I wanted it to do.
With regards to data-loss bug - the brief I had provided the develoer was to update the existing address with matching information so that we dont have a case of duplications for address. That way we avoid 2 issues 1) New taxonomy terms dont get created for exisiting addresses and 2) As we are attempting to use the autocomplete functionality for adressess..if there are multiple similar addresses, then the autocomplete form could result in lots of similar entries showing which could confuse users
#6
Subscribing, greetings, Martijn
#7
Subscribing too. It would be nice if this could be implemented.
Greetings
#8
There's a stand alone module that does this task here. Still under development.
#9
subscribing
and curious to when this great module will get committed to drupal.org
Thanks