README.txt 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. __ _ _ _
  2. / _(_) | | | |
  3. __ _ ___ ___ | |_ _ ___| | __| |
  4. / _` |/ _ \/ _ \| _| |/ _ \ |/ _` |
  5. | (_| | __/ (_) | | | | __/ | (_| |
  6. \__, |\___|\___/|_| |_|\___|_|\__,_|
  7. __/ |
  8. |___/
  9. CONTENTS OF THIS FILE
  10. ---------------------
  11. * About Geofield
  12. * Install
  13. * Configure
  14. * Credits
  15. * API notes
  16. ABOUT GEOFIELD
  17. --------------
  18. Geofield (http://drupal.org/project/geofield) is a Drupal 7 module that
  19. provides a field types for storing geographic data. This data can be attached
  20. to any entity, e.g., nodes, users and taxonomy terms. Geofield provides
  21. different widgets for data input and formatters for data output. The Geofield
  22. module can can store data as Latitude and Longitude, Bounding Box and Well
  23. Known Text (WKT) and it supports all types of geographical data: points,
  24. lines, polygons, multitypes et cetera.
  25. Great documentation on Geofield can be found at http://drupal.org/node/1089574
  26. INSTALL
  27. -------
  28. Install the modules Geofield and geoPHP in the usual way. General information
  29. on installing Drupal modules can be found here: http://drupal.
  30. org/documentation/install/modules-themes/modules-7
  31. Optionally install Open Layers 2: http://drupal.org/project/openlayers
  32. CONFIGURE
  33. ---------
  34. To add a geofield to a content type go to /admin/structure/types/ and choose
  35. "Manage fields" for the chosen content type. Add a new field of the field type
  36. "Geofield", and choose the preferred widget, e.g., "OpenLayers Map". Configure
  37. the field according ton the chosen options.
  38. Geofield comes with the basic but easy-to-use submodule Geofield Map that
  39. allows you to display geographical data in a Google map. Enable Geofield Map
  40. at /admin/modules. Read more about Geofield Map at
  41. http://drupal.org/node/1466490
  42. For more advanced and flexible data display you need to configure or create a
  43. map in OpenLayers at /admin/structure/openlayers/maps. You can easily create
  44. your own map by cloning an existing one. An introduction to OpenLayers can be
  45. found here: http://drupal.org/node/1481374.
  46. When you have configured a map in OpenLayers you must define to use the map.
  47. Go to /admin/structure/types and choose "Manage display".
  48. Note: you can also add a geofield to a user, a taxonomy term or a comment.
  49. CREDITS
  50. -------
  51. Original author: Tristan O'Neil
  52. Contributors: Alex Barth, Jeff Miccolis, Young Hahn, Tom MacWright,
  53. Patrick Hayes, Dave Tarc, Nikhil Trivedi, Marek Sotak,
  54. Khalid Jebbari, Brandon Morrison, David Peterson
  55. API NOTES
  56. ---------
  57. Geofield fields contain nine columns of information about the geographic data
  58. that is stores. At its heart is the 'wkt' column where it stores the full
  59. geometry in the 'Well Known Text' (WKT) format. All other columns are metadata
  60. derived from the WKT column. Columns are as follows:
  61. 'wkt' WKT
  62. 'geo_type' Type of geometry (point, linestring, polygon etc.)
  63. 'lat' Centroid (Latitude or Y)
  64. 'lon' Centroid (Longitude or X)
  65. 'top' Bounding Box Top (Latitude or Max Y)
  66. 'bottom' Bounding Box Bottom (Latitude or Min Y)
  67. 'left' Bounding Box Left (Longitude or Min X)
  68. 'right' Bounding Box Right (Longitude or Max X)
  69. When a geofield is saved using the provided widgets, these values are passed
  70. through the geofield_compute_values function in order to compute dependent
  71. values. By default dependent values are computed based on WKT, but this may be
  72. overriden to compute values based on other columns. For example,
  73. geofield_compute_values may be called like so:
  74. geofield_compute_values($values, 'latlon');
  75. This will compute the wkt field (and all other fields) based on the lat/lon
  76. columns, resulting in a point. As a developer this is important to remember if
  77. you modify geofield information using node_load and node_save. Make sure to
  78. run any modified geofield instances through geofield_compute_values in order
  79. to make all columns consistent.