/[drupal]/contributions/modules/geo/geo.module
ViewVC logotype

Diff of /contributions/modules/geo/geo.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.28 by vauxia, Mon Nov 9 17:44:40 2009 UTC revision 1.29 by vauxia, Tue Nov 17 19:07:21 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: geo.module,v 1.27 2009/08/07 16:55:12 vauxia Exp $  <?php // $Id: geo.module,v 1.28 2009/11/09 17:44:40 vauxia Exp $
2    
3  /**  /**
4   * Geo: Geospatial storage and retrieval.   * Geo: Geospatial storage and retrieval.
# Line 275  function theme_geo_fields($element) { Line 275  function theme_geo_fields($element) {
275   * A #process handler for the latlon element.   * A #process handler for the latlon element.
276   */   */
277  function geo_latlon_process($element, $edit, $form_state, $form) {  function geo_latlon_process($element, $edit, $form_state, $form) {
   $field = $form['#field_info'][$element['#field_name']];  
   
278    $element['lat'] = array(    $element['lat'] = array(
279      '#type' => 'textfield',      '#type' => 'textfield',
280      '#title' => t('Latitude'),      '#title' => t('Latitude'),
# Line 301  function theme_geo_latlon($element) { Line 299  function theme_geo_latlon($element) {
299    return theme('form_element', $element, $output);    return theme('form_element', $element, $output);
300  }  }
301    
 function geo_element_set_value($element, &$form_state) {  
   if (!$element['#value']) $element['#value'] = $element['#default_value'];  
   if (!isset($element['#gis_input_value'])) $element['#gis_input_value'] = $element['#value'];  
   
   $value = geo_value_convert($element['#value'], $element['#gis_input'], $element['#gis_output']);  
   $element['#gis_output_value'] = $value;  
   form_set_value($element, $value, $form_state);  
   return $element;  
 }  
   
302  function geo_value_convert($value, $in = 'array', $out = 'wkt') {  function geo_value_convert($value, $in = 'array', $out = 'wkt') {
303    // TODO We are taking the element's requested input and output formats, and    // TODO We are taking the element's requested input and output formats, and
304    // making the necessary adjustments.  This needs to be refactored and set up    // making the necessary adjustments.  This needs to be refactored and set up

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.3