July 14, 2011
Set up OpenLayers on Drupal 7
First Drupal 7 How to post!!
Goal: Get basic CMS GIS capabilities running on D7 using an opensource approach. I've used GMap on D6 but want to switch - partially because of the source issue but also because OpenLayers can handle bounding boxes, WKT, etc.
Assumptions: I'm past the point of writing for complete newbies. Sorry, because I know what it is like when items are shortchanged but there is only so much time in the day.
1) Install Drupal 7 - that's all the help you get. Hint, it's pretty much the same as D6.
2) Install OpenLayers
$ cd sites/all/modules
$ sudo wget http://ftp.drupal.org/files/projects/openlayers-7.x-blah.tar.gz
$ sudo tar -xzf openlayers-7.x-blah.tar.gz
3) Install GeoField and Libraries
- OpenLayers does not support fields (CCK) in D7. It is recommended that you use GeoField.
- As of July 14th, 2011 you need the dev version of GeoField!!
- GeoField should give us the ability to add, well, a geo field to our content types
4) Enable Modules
- Visit admin/modules
- OpenLayers UI, OpenLayers, Geofield, Libraries
- Note: I don't have Views on this install yet but OpenLayers Views will be used at a later date.
5) Configuration Notes
- Openlayers is found at admin/structure/openlayers and admin/people/permissions#module-openlayers_ui
- I didn't immediately find config spots for GeoField and Libraries
6) Add a GeoField to a content type
- Visit Content Type Structure (admin/structure/types)
- Pick a CT and add a new GeoField (Widget = Well Known Text) - I'm not 100% certain on the other Widgets but feel free to experiment.
Notes: I hit these messages:
- "Plot Location has no field settings."
(I saved past this but recommend going back in to check your settings.)
- "Unable to load geoPHP library. Not all values will be computer [sic] correctly"
(Hmmm...this looks potentially troublesome, especially if geoPHP doesn't ship with whatever version of PHP we are using)
I changed the widget to OpenLayers Map because I need a map interface to input WKT values. I got a map but lost WKT. I also got this error:
Notice: Trying to get property of non-object in geofield_form_latlon_map()
(line 166 of /var/drupal7/sites/all/modules/geofield/geofield.widgets.inc).
7) Create a node with a GeoField field.
Posted by kkwaiser at July 14, 2011 11:17 AM
TrackBack URL for this entry:
Listed below are links to weblogs that reference Set up OpenLayers on Drupal 7:
Tracked on February 10, 2014 06:41 AM
Tracked on February 12, 2014 09:02 AM
Tracked on February 17, 2014 09:25 PM
Tracked on February 17, 2014 10:10 PM
Tracked on February 26, 2014 01:07 AM
Tracked on February 27, 2014 06:18 AM
Tracked on February 28, 2014 07:14 PM
Tracked on March 2, 2014 08:40 PM
Tracked on March 2, 2014 09:09 PM
Tracked on March 6, 2014 11:08 AM