Closed (duplicate)
Project:
Location
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Created:
7 Mar 2008 at 21:46 UTC
Updated:
9 Oct 2008 at 23:05 UTC
This issue is a placeholder for discussing UI changes.
HEAD currently has a tableless cssified UI for the location entry form, but it needs to be tested cross browser and discussed.
Comments
Comment #1
wim leersPerhaps this is the right time then, to ask for initial feedback (possible tricky things I should take into account) before supporting the location CCK field in my Hierarchical Select module through a CCK widget?
Hierarchical Select expects – surprise, surprise – a hierarchy to work with. Obviously you *can* represent locations as hierarchies, but not everything . Country > state/province > city/postal code would work (on condition that every country has states defined, as well as postal codes, which is unlikely, so you would have to be able to fall back). But to be able to enter addresses, you will always need additional text fields.
Thoughts?
Comment #2
bdragon commentedI was actually looking at hierarchical select when thinking about this. Does the js degrade gracefully?
Some countries are administratively divided differently than others. Some countries aren't even consistent internally. Japan, for example, has some city/urban-like divisions on the top level. (http://en.wikipedia.org/wiki/Prefectures_of_Japan)
Also, postal codes are completely different than administrative boundaries in most countries, and shouldn't be part of the hierarchy *at all.*
This would work best as a hierarchy where each item knows what it is representing... (state/province/prefecture/city/region/department/town/village/division/whatever)
Comment #3
wim leersWhen JS is disabled, a normal select is used. For version 3, I will provide more graceful degradation (which will also solve scalability issues when you've got thousands of nodes in the tree).
Postal codes not part of the hierarchy: no problem.
I'm not sure what you mean by "each item should know what it is representing", but: you have to generate some sort of identifier for each item in the tree (like taxonomy's term ids). You could easily make it such that you embed the "location type" (for lack of a better term) in this identifier.
To get an idea of how this would work, please give a look at the taxonomy implementation. See the Hierarchical Select hooks section, except for the hook_hierarchical_select_form_alter() implementation, that's irrelevant for location. I've copy/pasted all current code here, so you don't have to go through that rather large file: http://drupalbin.com/1189.
Comment #4
wim leersStatus update: Hierarchical Select 3 now has the more graceful degradation I was talking about, and the scalability issues have been solved. I hope to have the final ready in a couple of weeks.
Writing implementations is easy, but before I write one for the location module, I'd like to know if the API is considered stable? At least the part that I'm going to use. If there's no API for this part (i.e. I have to write the queries myself), then the question is if the database structure is considered stable.
Comment #5
jasontanner commentedI'm not sure if you have already considered this but it might be useful to have a grouping at a higher level than country - e.g. continent (or region). I have found this especially useful when searching - rather than on location entry.
Examples would be: Europe, Middle East, Africa, North America, South America, Oceania with countries grouped in each level. There are standard mappings for countries to region available that can be reused (http://en.wikipedia.org/wiki/List_of_countries_by_continent). I think I also have a couple of database tables I can provide dumps of that contain the mappings.
Comment #6
wim leersjasontanner: that's one of the things I asked Bdragon to add, as per http://drupal.org/node/31609#comment-906923.
Comment #7
jasontanner commentedwim: did you get any indication as to whether it would be included for sure ?
And to clarify I mean: Continent -> Country -> (Region aka Province aka State aka Country)
Comment #8
wim leersNope: I didn't get a reply yet.
Comment #9
bdragon commented#165040: [master]Improve UI for entering and geocoding of locations is the new master issue.