Hierarchical Select widget for Geonames

bangpound - April 18, 2009 - 05:01
Project:GeoNames
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:bangpound
Status:reviewed & tested by the community
Description

This module implements the Hierarchical Select widget API to provide a widget for selecting a Geoname.

The widget is very demanding on the web service, so it's crucial that you've set up Geonames to cache result data for a good amount of time.

AttachmentSize
hs_geonames.info212 bytes
hs_geonames.module1.48 KB

#1

andreiashu - May 5, 2009 - 15:08

unbelivable !!!
I just need this :)
I'll test this out and give feedback here

#2

andreiashu - May 5, 2009 - 16:22

hmm.. oki. stupid question: how do I test it out ?
Do I have to write some code or it should be somewhere in the UI ?

#3

bangpound - May 6, 2009 - 02:12

It's a HS widget, so you need to create a form that wants a Geonames ID.

#4

andreiashu - May 6, 2009 - 14:15

Thanks bangpound, that did the trick. It is my first time I'm trying out HS or Goenames modules.
The module itself works great. I also tested the '#default_value' option and works like a charm.

I only had a small issue: the 'max_allowed_packet' property from my.cnf that was set too low - but of course this is a server issue.

I have one question, maybe you can give me some advice: what would be the best way to store the selected data from the created form element ?
Right now I'm using a hook_form_alter to inject this hs element into the node edit form and in a validate function I assign the selected geonameid to a CCK text field. Is there another better solution ?

Thanks for your time.

#5

bangpound - May 6, 2009 - 23:17

CCK may raise issues that I've not encountered yet. I'm using the element on a custom form which has a custom submit handler for capturing and storing the value. I'm not using it on nodes or with CCK.

Hierarchical Select doesn't have any modules that work with CCK, does it? I think any limitations about this module would be common to HS.

If you're working only with a single valued field, you might try replacing the element type in hook_form_alter, but you'd be experimenting in ways I've not!

#6

andreiashu - May 7, 2009 - 06:28
Status:needs review» reviewed & tested by the community

Thanks for the info. I think it is worth researching some more about HS with CCK but I'm sure I'll find a lot info in the issue queue.

About this little but very nice module (I'm still playing with it, no problem so far): will you make a separate project for it or maybe try to see if the maintainers of Geonames adopt it ? It would be a pity if it would remain just here as an attachment to this issue.

#7

bangpound - May 7, 2009 - 11:27

Right now, I think it belongs with Geonames. I have a module in development that depends on HS, Geonames and Location_Taxonomy. The developer of HS said that my work on this widget belongs with Geonames.

#8

andreiashu - October 19, 2009 - 12:53

Just bumping this so maybe a Geo maintainer sees it.

 
 

Drupal is a registered trademark of Dries Buytaert.