| 1 |
<?php // $Id: geo.module,v 1.9 2008/08/11 03:24:22 vauxia Exp $ |
<?php // $Id: geo.module,v 1.10 2008/09/09 00:31:55 vauxia Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Geo: Geospatial storage and retrieval. |
* Geo: Geospatial storage and retrieval. |
| 43 |
} |
} |
| 44 |
|
|
| 45 |
/** |
/** |
| 46 |
|
* Implementation of hook_theme(). |
| 47 |
|
*/ |
| 48 |
|
function geo_theme() { |
| 49 |
|
$file_path = drupal_get_path('module', 'geo') .'/includes'; |
| 50 |
|
return array( |
| 51 |
|
'geo_formatter_default' => array( |
| 52 |
|
'arguments' => array('element' => NULL), |
| 53 |
|
'file' => 'geo.formatters.inc', |
| 54 |
|
'path' => $file_path, |
| 55 |
|
), |
| 56 |
|
'geo_formatter_lat' => array( |
| 57 |
|
'arguments' => array('element' => NULL), |
| 58 |
|
'file' => 'geo.formatters.inc', |
| 59 |
|
'path' => $file_path, |
| 60 |
|
), |
| 61 |
|
'geo_formatter_lon' => array( |
| 62 |
|
'arguments' => array('element' => NULL), |
| 63 |
|
'file' => 'geo.formatters.inc', |
| 64 |
|
'path' => $file_path, |
| 65 |
|
), |
| 66 |
|
'geo_formatter_georss' => array( |
| 67 |
|
'arguments' => array('element' => NULL), |
| 68 |
|
'file' => 'geo.formatters.inc', |
| 69 |
|
'path' => $file_path, |
| 70 |
|
), |
| 71 |
|
'geo_formatter_svg' => array( |
| 72 |
|
'arguments' => array('element' => NULL), |
| 73 |
|
'file' => 'geo.formatters.inc', |
| 74 |
|
'path' => $file_path, |
| 75 |
|
), |
| 76 |
|
); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
/** |
| 80 |
|
* Implementation of hook_field_formatter_info(). |
| 81 |
|
*/ |
| 82 |
|
function geo_field_formatter_info() { |
| 83 |
|
// TODO some other formatters: asKML, asGML, asGeoRSS, etc |
| 84 |
|
// TODO Can we do math on the field? area, length, etc? |
| 85 |
|
$field_types = array('geo', 'geo_data'); |
| 86 |
|
return array( |
| 87 |
|
'default' => array( |
| 88 |
|
'label' => t('Well Known Text'), |
| 89 |
|
'field types' => $field_types, |
| 90 |
|
), |
| 91 |
|
'lat' => array( |
| 92 |
|
'label' => t('Latitude'), |
| 93 |
|
'field types' => $field_types, |
| 94 |
|
), |
| 95 |
|
'lon' => array( |
| 96 |
|
'label' => t('Longitude'), |
| 97 |
|
'field types' => $field_types, |
| 98 |
|
), |
| 99 |
|
'georss' => array( |
| 100 |
|
'label' => t('GeoRSS'), |
| 101 |
|
'field types' => $field_types, |
| 102 |
|
), |
| 103 |
|
'svg' => array( |
| 104 |
|
'label' => t('SVG'), |
| 105 |
|
'field types' => $field_types, |
| 106 |
|
), |
| 107 |
|
); |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
/** |
| 111 |
* Implementation of hook_geo_views_api(). |
* Implementation of hook_geo_views_api(). |
| 112 |
*/ |
*/ |
| 113 |
function geo_views_api() { |
function geo_views_api() { |