Changes between Initial Version and Version 1 of BluePrint/GIS/LocationSelector

11/18/10 12:40:01 (12 years ago)
Fran Boon



  • BluePrint/GIS/LocationSelector

    v1 v1  
     2= Location Selector =
     3We want a widget which can be embedded within a form to be able to select the appropriate location to associate with a record using either hierarchical dropdowns or a precise location.
     5== Status ==
     6We have a widget in {{{views/gis/location_autocomplete.js}}}
     7 * this is added manually to many view templates (often this is the only customisation for that view)
     9This supports:
     10 * [wiki:BluePrintGISLocationsHierarchy Hierarchical Level] selector to choose the correct level or select the correct Parent
     11 * [wiki:BluePrintGISGeolocator Geocoder] lookup of a Street Address
     12 * Map-based lookup of Lat/Lon
     13 * Manual entry of of Lat/Lon (either from a GPS or looked up in an online resource like Wikipedia)
     14   * A Conversion tool is available to convert from Deg/Min/Sec to Decimal Degrees
     16== !ToDo ==
     17 * Redesign the Look/Feel to make it more usable
     18  * Display all the Lx layer dropdowns from the start?
     19  * Hide the 'Add New Location' options behind a button (CSS Hide)
     20  * Hide the Lat/Lon entry forms behind an 'Advanced' button (CSS Hide)
     21  * Don't load the Map within the page but do this as a separate server-side call
     22 * Make it work with components (see below)
     23 * Move the implementation to a server-side widget so that it applies automatically to all instances of the field (can then remove from custom view templates)
     24 * add an HTML5 GeoLocation option ('Current Location')
     25 * set the map entry default lat/lon/zoom based on the selected Level in the Hierarchy (assumes we have at least Centroid information available, ideally use Polygons where we have them)
     26 * display the geocoder results on a map for visual confirmation that the correct result has been returned
     27 * if we have admin boundaries available then the Lat/Lon provided can be validated against the selected Lat/Lon
     28 * if we have admin boundaries available then the correct hierarchy can be filled-in automatically if just the Lat/Lon are provided
     30=== Known Issues ===
     31There are various bugs in the current implementation, some of which are listed below.
     33==== Duplication of location records ====
     34This happens when you for example create a new hospital record without creating a new location, but just selecting one (just select a country, for example). When you submit, then a new location record is created with the same name as the selected one - this seems wrong. You can make it visible by uncommenting the show_status line. The reason for this behaviour is that S3.gis.uuid is empty in case there is no old_location, which triggers the creation of a new record. Thus, this does not happen in update, and not either when you create a new location (which creates a new location anyway :D).
     36==== Use in Component Forms ====
     37To be able to apply the location selector to components (e.g. person/presence, where it would be *very* useful), we need to go away from the 'request.controller+"_"+request_function' construction and instead use jr.
     39Perhaps this way:
     41 {{try:}}
     42   var location_id = '{{=jr.prefix+"_"[1]+ "_location_id"}}';
     43 {{except:}}
     44   var location_id = '{{=request.controller+"_"+request.function+ "_location_id"}}';
     45 {{pass}}
     49[wiki:BluePrintGeographicInformationSystems GIS BluePrints]