Basic setup of Drupal 7 + OpenLayers + Geofield + Views 3

Our goal

This configuration will setup Drupal 7 with our nodes plotted on an OpenLayers map, using Views module to gather and channel the information to the OpenLayers module. And Geofield letting you input geo data easily via the node add form. We'll also have the OpenLayers Cluster strategy implemented.


Drupal 7 has been out there for a while already, but not all modules have gotten around yet being compatible. While development on the needed modules for this setup is in beta and RC fases, the documentation is also ... in that fase or say ... not yet completely up to version.

After reading a lot of posts and some Drupal handbook pages on this subject, I noticed most of them are still aiming at D6. And a lot of questions about Drupal 7 versions are not really answered. So I've put together a small how-to combining notes from other posts and a bit of common sense and came to this configuration.

Let's get started!

Step 1: Install Drupal + the modules

Required modules:
Install Drupal 7 (used 7.12 at the time of writing)
Install Views3 (used views-7.x-3.3)
Install CTools (used ctools-7.x-1.0)
Install GeoField (used geofield-7.x-1.0)
Install OpenLayers (used openlayers-7.x-2.0-beta1)
Install Libraries (used libraries-7.x-1.0)
Install library geoPHP (used geoPHP version 0.8)
Download the geoPHP library from
From the README:

Unarchive the library files and place in sites/all/libraries
Your directory structure should look like: /sites/all/libraries/geoPHP/

Install Devel module (used devel-7.x-1.2.tar.gz) to generate a bunch of nodes to display on the map.

Quick install of Drupal 7 + the modules above using Drush:
In my setup the webroot directory is called 'oltest7'. So the first command would be run from /var/www for example.

Note: The setup of Drush is not part of this how-to.

drush dl drupal-7.x --drupal-project-rename=oltest7
cd oltest7
drush si minimal --db-url=mysql://root@localhost/oltest7_2
# newer Drush versions will print your User name and User password
# enable the field ui
drush en field_ui
# install view 3 + ctools
drush dl views-7.x
drush en view views_ui
# it will ask to donwload ctool because it views depends on ctools
# answer (y) to all
# install geofield + library
drush dl geofield-7.x
drush en geofield
# it will ask to download library module and enable it
# answer (y) to all
# install openlayers
# most stable at this point is beta 1
drush dl openlayers 7.x-2.0-beta1
drush en openlayers_views openlayers_ui openlayers
# optional: install devel for node creation
drush dl devel-7.x
drush en devel_generate devel
# install the geoPHP library
# from the web root directory
mkdir sites/all/libraries
cd sites/all/libraries
wget --no-check-certificate
tar zxvf geoPHP.tar.gz

Depending on your Drush version...
The user / pass to your new site will be admin / admin or Drush will print out the user name and user password just after the Drush si command.

Step 2: Configure the OpenLayers module

Drush installed all modules in sites/all/modules/.
This shouldn't matter, but it's just here as a side note.

Step 2.1: Configure OpenLayers Geofield WIDGET map

We'll set a basic configuration for a map we use to enter the location data into Drupal.

# Go to 
# and 
clone the WIDGET map
Give the map title a name that makes sense to you, so you can recognize it later on.
# and

You can configure the map later in the way you want it to work for your users.

Step 2.2: Configure OpenLayers Geofield FORMATTER map - part 1

This step is a lot like the config for the widget map, but this map will be used for output. The nodes will be plotted on this map.

Again, we'll set a basic configuration for a map we use to output the location data from Drupal.

# go to 
# and
clone the Geofield Formatter Map map
Give the map title a name that makes sence to you, so you can recognize it later on
# and

You can configure the map later in the way you want the output to display your nodes.
We'll come back to this later to configure the Cluster strategy on the map.

Step 3: Configure a content type

We'll need a content type to enter nodes.
This content type will need a field to hold the geo data.

# go to

# and
add content type which suits your needs
# I used "Map item" for this example, the machine name will be "map-item".
Edit the content type and add a field
with name = "Location"
of type = "Geofield"
of widget type = "OpenLayers Map"

In the field configuation:

select the widget you configured in the previous step (2.1) for
"OpenLayers Map" setting.
# and
select "Store each simple feature as a separate field." from the Storage options

The latter will store the points and lines as single features, for my case this was what I wanted, mainly because of counting the single features.

Step 4: Add some nodes

At this point it's practical to quickly add some nodes so you'll some data show up when you create the views.

Step 5: Configure Views

We use Views to scrape for nodes and send em of the to OpenLayers.
In Views we'll create two displays:

  1. a page showing the maps,
  2. an "OpenLayers Data Overlay"

Step 5.1: Add and configure a Views OpenLayers Data Overlay

Add the view

# go to 
# configure the view
show = content
type = Map item (or whatever ctype name you used)
# You don't have to create a page at this point yet.
Click "Continue and Edit"

Once you're in the view..
The Format show will be set to Fields and the Content: Title field will be added there by default.
We'all also need the geo information for the map. In view:

Add the "Content: Location" field
# Save it with the default settings

This display is were we actually scrap Drupal for the nodes to plot on the map!
After we add the OpenLayers Data Overlay display:

# At the top of the view 
click the "+ Add" 
# to add a views display and 
select "OpenLayers Data Overlay"

In the Format/Format section of the display:

select the "OpenLayers Data Overlay" radio
# next
In the "Map Data Sources" select box, select "WKT".
In the "WKT Field" select box, select "Content: Location".
In the "WKT Title" select box, select "Content: Title".

Note: Override the settings for this views display if you'll be adding more displays to this view. Don't apply the OpenLayes Data Overlay to all the displays!

I only configured the title field, since it's all I want to show in the map popup balloon. If you want to show another node field, configure the Description field in the section above with node field you would like to see in there. You'll have to go back and add the field to the view before you can configure it in the OpenLayers Data Overlay settings.

At this point you should see some WKT appear in the Views preview for the nodes you have entered already.

Step 5.2: Add and configure a Views page

This is were we plot the scraped nodes from 2.3 on the map!
Note: You could do this in an entirely different view.

# at the top of the same view 
click the "+ Add" 
# to add a views display and 
select "Page"

In the Format/Format section

select the "OpenLayers Map" radio

In the Map select box,


In the Page settings/Path section

type path where this page will be at. 
# I used "map", my page will be at http://localhost/map

Note: There won't be any nodes showing on the map just yet, since we haven't configured the map to show them ... yet!
We'll do this next... first: Save the view!

Step 6: Configure Geofield FORMATTER map - part 2

We want to the node to show up on the map. For this to happen we have to add the OpenLayers Overlay Data layer to the map.

# go back to 
# and 
edit the Geofield formatter map
go to vertical tab "Layers and styles" 
# and 
in the "overlay" table tick the checkboxes "Enabled" and "Activated" 
of your newly created OpenLayers Data Overlay
# and 
hit "Save"

If you go to the page you've just created. You should see a map with you nodes showing up.

Step 7: Cluster strategy (Optional)

Cluster Strategy let's you group the nodes to one point on the map for points that are close to each other. This functionality is in OpenLayers module already. We only have to enable it in the Formatter map.


# go to
# and 
edit your Geofield FORMATTER map
click the vertical tab "Behaviors"
tick the "Cluster Features"
tick the "<openlayers data overlay created by views>"
Distance = 20 # pixel distance on the map at the current zoom level
Threshold = 2 # minimal feature count within the "Distance"
Click "Save"

Go to the page you create to show the map and hit 'refresh'. Depending on the zoomlevel your map features / nodes will the clustered into 1 feature.

Note: If you used Devel module to generate nodes, then the Cluster strategy might show unexpected output when it comes to multipoint, polygon and line entries.

Step 8: Pop Up for Features (Optional)

The Pop Up for Features functionality provides a small balloon on the map when you click the feature. It's on the page and vertical tab as the Cluster Strategy functionality.


# go to
# and 
edit your Geofield FORMATTER map
click the vertical tab "Behaviors"
tick the "Pop Up for Features"
tick the "<openlayers data overlay created by views>"
Click "Save"

And that's it!
If you followed all the steps above you should now have a view showing a map using the OpenLayers module. Displaying your nodes with Cluster Strategy and Popup up balloons when you click on the feature in the map.

Comments? Suggestions?
I'll try adding some screenshots soon.

@todo: Add screenshots.


I've created a map exactly as you show. But I don't see a way to change the locations once I've placed an icon pin. Suppose I drop it in the wrong location first time and simply want to move it? (using Drupal 7) How would I do this?

I guess if you have an answer for me, please email me because I don't see a place to look for answers to the comments.



Member since:
1 juli 2010
Last activity:
2 jaar 35 weken

We simply re-drop the pin. So we don't actually move/modify the existing pin.
Our map is configured to allow only one pin. So clicking the map in a different spot, will move the pin.

I know there is a button (plus-sign with arrows) to modify an existing pin, but that doesn't seem to work that well. I haven't tried it with newer versions of the OpenLayers or Geofield module. So handling multi point features could be a problem in this case.

Is there a way to have an attachment or something that lists the location names of the markers on the map and when you mouse over them it triggers the correct tooltip of pop up?

Thanks great tutorial...
Might want to add Mollom to check spam in comments (and add Botcha and Captcha modules). It will get rid of pretty much all spam for Drupal.

Member since:
25 maart 2010
Last activity:
1 dag 17 uur

We are already using Mollom and it filters most of the spam but sometime something slips through. I've cleaned the mess.

oscozgmlge Canada Goose Jacka flkdsgxbtk Nike Air Max 90 ermewvknwf Barbour Outlet vpnvzypoos French Blue 7s abzutfwzmb Cheap Uggs On Sale zglvwjanxq peuterey xkuijvclan Nike Air Max 90 efqlaqepio Barbour Jakke Danmark tagtqmydob Abercrombie Norge apzlqddkfi Duvetica Jackets

owupsxolvd Doudoune Moncler nzyymmnaga Moncler Outlet ufevpuisyx Cheap Uggs On Sale dvfaeciwxx Cheap Barbour Jacket pcixtzrrng Woolrich Jassen irtnxwutod Ugg Baratas wvslzlapqu Woolrich Jassen wxwynetpww Jordan 4 Columbia hnrakjretp canada Goose Outlet icawqlnvts Nike Air Max Billigt

gwfnfuxvqn Botas Isabel Marant iaatjwieof Peuterey sfdxtwhrzs Nike Air Max 90 Billigt llynineoiq Uggs Outlet wpkjzbylnm Moncler Online lxvfrouduq Cheap Canada Goose Jackets mlquyyfyoq air max 1 baratas trmrqbwrte Jordan 7 French Blue stllkbjiql Canada Goose Jacket ssyuquygip nike cortez schoenen

Simply want to say your article is as surprising. The clearness in your post is simply nice and i could assume you're an expert on this subject.
Well with your permission allow me to grab your feed to keep up to date with forthcoming post.
Thanks a million and please keep up the rewarding work.

Also visit my site ... cheap security cameras and monitors

ldxrsebeay Doudoune Moncler Pas Cher dpsmdiopka Nike Air Max eoogqrfali Canada Goose vwkomouivg Canada Goose Outlet edohcnwerd Nike Air Max 1 Pas Cher vrekniftfh Billige Canada Goose ghqoggdelx Columbia 4s 2015 vnrnxbbemq Uggs Skor hlepwcgvwz Cheap Ugg Boots qxetqwajdh Bottes UGG

eafnhqwbhe Cheap Nike Air Max lingrfwpaf Nike Air Max Billigt ifkpygvjut Jordan 4 Columbia 2015 tpbciseixd Hollister España qlrlodyoex Belstaff Jacket gdvqhdjxwb Peuterey Outlet qcltswunhd Nike Air Max Baratas ficcqyrrso hollister mlsyeucwnx Uggs Boots bzkawaonub Canada Goose

tbaaieucxl Hollister Madrid xawrckrvxn Pandora Jewelry wublcptzgj Canada Goose Jacka wiqmfkwidl Longchamp nwausdqqfz Parajumpers owqpadbcqv Płaszcze woolrich ifunwvwdrt Cheap Canada Goose Jackets cvghrtdrps hollister amsterdam cwblsgqcxv Abercrombie And Fitch dovoaowycu Canada Goose

zlcaqauvum UGGs On Sale xpihihskri Canada Goose Outlet qocbaksobx Nike Air Max 1 Baratas cuumszjqex Cheap Uggs bfkhlemgwz uggs Sko ovdbbpfxhy cortez online ylcjnkuiqe Duvetica qjzgcboulo Canada Goose Jacket oqqvgmmozr Nike Air Max 90 billig ddnssyelng French Blue 7s

bqtfcppsca Duvetica Jackets cafzvvltms Cheap Woolrich Parka iotylsjuvl Nike Air Max 2014 Shoes rebditbiiv Billiga Canada Goose Jacka upcfcbqhhp nike air max 1 norge prtkscawwi Jordan Shoes Uk brxozkamde jordans goedkoop ptpqtroaqy UGGs amapatgdik Canada Goose ycizuathzw Bottes Ugg Pas Cher

Ridiculous story there. What happened after?


oqyhtmlfte Columbia 4s 2015 tlizrgjiji nike air max 1 ioqfmibuya billige hollister yuuxclajqs Canada Goose Jacka quqzbnrnxv Bottes UGG zwvctbimxr MBT UK udbclfrxrl Nike Air Max Baratas sawnhluywn Peuterey Outlet uyozhxjcve Air Max 1 iltuheijbl beats by dr dre

njxfphjwya UGG Pas Cher ubknqysrxf Parajumpers Rea hlhtwvwiul Parajumpers Outlet yhhgwtberr Nike Air Max 90 Baratas xrfyntxvvh Jordan 4 Columbia 2015 csmasnzvjt air max 1 baratas khewbdwpdx Canada Goose mpedoyhgqh Canada Goose Jackets nuaccyjzmy Nike Free Run España ezmgvvyfxg Duvetica Outlet

eklodtakoz hollister nettbutikk irgfnilars Woolrich Uk qkbxpcbhem cheap jordans ggkncrlfgy Goedkope Woolrich hwktjptkrc peuterey Outlet fbvxigdtld Hollister Outlet shokhitlav Woolrich UK iakvnxqptn Cheap Air Max 1 zgijttcema Bottes Ugg Pas Cher nekxmtfoan Air Max 1

cutssqsdnd Ugg Boots Canada gvfnivjakf woolrich qsehkwbgbf Woolrich Outlet galvbclmwq Cheap Jordan Shoes bxknogduhb Stivali UGG tegaywtcil Cheap UGG Boots qxquhmlkds Woolrich Online mlvhhnykwt cheap air max 90 mrjxhmapvh Nike Air Max nsivbqsoop Zapatillas Jordan Baratas

wwzvtplzhm Giubbotti Peuterey wqoekbuxyp Barbour København uscficwwaj Bottes Ugg Pas Cher myrauxleiy Hollister vwqnzatphv Giubbotti Belstaff Outlet ufphtqexqp Belstaff Outlet sqtoewvaot Barbour Outlet  fplmknssbe Cheap Jordan 11 qniexkdwkk Canada Goose xuffmnkneu Belstaff Canada

hpvciikpxb canada Goose Outlet rjkvbauncq Botas Ugg zvwmepnjds nike air max uiradgerxr Barbour Outlet aqnhlsirwl Zapatillas Nike Free jwnewlpuhv Canada Goose Pas Cher gmvicrwryd Nike Air Max España aykxzhfiye Jordan 11 Concord For Sale yeacuqmfsk Moncler Jackets For Men loqbqzumzc Doudoune Moncler

jqkjurfvut Cheap UGGs edtowepteb UGG Outlet akakxribzn Jordan 7 French Blue alzgstbpfs Cheap Woolrich Parka mqasvbgqgj Isabel Marant weybhxchcu Nike Air Max 90 Baratas ouaisjixos Cheap Uggs Uk rnubpiwloc Canada Goose lvsarctxae isabel marant sko mjvsicvcxb Billige Canada Goose

utipgtvyft Canada Goose ocngkzgejw Bottes UGG Pas Cher hhackvjzor Cheap Woolrich Parka kzrrnvtlak Peuterey nojboqcrsp Canada Goose Italia ipulwatotc Hollister jvlumlblro Canada Goose Jacket bwoukaklnf nike free billig vvadufiqyo Isabel Marant rsrdqgvozk Parajumpers Jakke

zcwcaxcwis Doudoune Canada Goose Pas Cher cwkgxbxfgq Ugg Boots Outlet znfvkyechq uggs Outlet fssunoprei Peuterey Jacket fvhzbyyqnk Air Max Pas Cher aaziroxlel Ugg Boots On Sale slitchzlkr Air Jordan Baratas pigebqgeek Uggs Kopen expiewlzwo Hollister Sale wbezlaesak Canada Goose

lfbnypznbr French Blue 7s nnvbkjogqg Woolrich Factory Outlet yruehivqtb Isabel Marant Shoes dydhbtpaah Billiga Uggs Skor kdpmwtkjwk Woolrich Canada mzrhxcnbqh Air Max 1 eovlybtrdf Giubbotti Peuterey hxrepkvqec Woolrich Outlet sabrpwudbw uggs Outlet mabuhpjjuy beats by dr dre

huvzrtrxak Nike Air Max nznfmmcsxq Woolrich ebgunmgogr Moncler Outlet bpmxisvcin Uggs Kopen kblfkvehmm Duvetica Outlet qxfonsdirk Nike Free Baratas qfrejrgzil Billiga Canada Goose Jacka scnyfyenmd Hollister Outlet brxzvclasb Parajumpers Jacka dqsordjyoj Canada Goose Jakke

sayfzoverm Cheap Woolrich Parka iaywvvelus Billige Canada Goose hqddjxnaqg Tiffany Outlet xqnujlzgcb Jordan 4 Columbia ctayjsgwmx Belstaff Cazadoras zyzxxvpnoi UGGs Rea fevakxbiun cortez españa vgzeddgtwr Bottes Ugg jnvhasgwky Woolrich Outlet vcewmpwkey French Blue 7s

bpwtrivcro Nike Air Max 90 España gkjxmwvqqb Billiga Barbour eizqbyjsfp Nike Air Max 90 España rtqtpidiya Peuterey Outlet srgriyispv Belstaff Göteborg tnacoeygds Billiga Canada Goose Jacka qzbpneezhn Jordan Retro 7 wejokctfad Ugg Pas Cher sxwtpcezty Woolrich lhtthjbwqs Woolrich Stockholm

jteuevnzwc Ugg Pas Cher twlqsrrnrh Belstaff Uk xhxvxqtijt Hollister Outlet xzwpoxwivf Stivali UGG ifxlztmjun Doudoune Canada Goose wsrogdcxic Billiga Nike Air Max nckzfdrmus Woolrich Jassen mwkbxzhysd cheap hollister uk oqzrfwwcyt Nike Free Run Baratas arbptpbcjq Cheap Uggs

qlzduzexfb Canada Goose Vest gkweqjvbpv Billig Woolrich jakke awxspvghav cheap nike free 3.0 orwuqflvci canada Goose Outlet fkpuaenzme UGGs On Sale vmlssuvmyr Canada Goose twbvnijfgu Bottes UGG Pas Cher iuypqnygme beats by dre kopen hfxypzssmu Barbour Jackets fpacuxpsml Nike Free Baratas

fbkxrurmiy Canada Goose zdhdcmydcb Michael Kors Rea pmbjdgqqdm Hollister Sverige pdcpjytmry Botas Ugg qwogroxkvg Hollister xcizwtyayu Cheap Parajumpers Jackets jqpiyzkhmq Moncler Jassen bhpkewprtn Foamposites For Sale ezxarsgdbd Longchamp Outlet qbjtaerepr Tiffany And Co Outlet

pdhtybdwbg Tiffany Bracelets Outlet sjpcovggyl Air Jordan Shoes nwnlovgonc Cheap Foamposites xcmcidzwyv Billiga Canada Goose Jacka tymaopqqzu Barbour zubvfpmypq Bottes Ugg Pas Cher qpvaouqmsr nike Air Max 90 rgcfthhvon Cheap UGG Boots UK yasewibnff Giacche Belstaff upzaxlkzpc Goedkoop Canada Goose

fxssldwxmp cheap jordans jajkhoumpb nike air max 1 goedkoop mboavxoekn Uggs Outlet iucpepywdy Michael Kors Madrid fpcnogvhxy Woolrich Jacka yxhtumfcwb French Blue 7s uwytyicsux Canada Goose Jacka fcmcbxenjw nike free 3.0 billig pyfpwaivkx Michael Kors Rea fxrxclmqym Cheap Ugg Boots Uk

wplhdnnyan Canada Goose Pas Cher mijwnjdqfo Barbour dqscrxzqfz Cheap UGG Boots UK clpwvqejre Belstaff Baratas jddjrhdgwx Abercrombie Norge xxmkaejwxv Goedkope UGGs nggecjljqf Cheap Hollister wfgyzkfxbd Uggs On Sale bqfhpktdyb Parajumpers cpgpebuoro Air Max 90

womcbkqeaj Hollister Outlet uqybesdvma nike air max 1 españa ycmbsgpzni Nike Air Max España lugacjmbgy UGGs Skor olrxppvcrh UGG Boots oiogcosivg bottes Ugg jzittwidix Beats By Dre zulomyxztw Uggs suzgtawzwd Uggs slwydwbxjp abercrombie and fitch

mqivazqvvt Louis Vuitton Norge rnaupxwxzf Jordans For Cheap snqgemgjdx Woolrich Outlet vtuwdkwyhr Nike Air Max bsejoueote Cheap Canada Goose Jackets lqeoxxnakm Hollister fegzqacdrg Barbour Outlet wwyswueqnh Isabel Marant gtfvznimao Uggs Kopen xkhjzrejnq Parajumpers Danmark

ljapxlevyk Air Max 87 Baratas hogjpvjwhx Belstaff Outlet lvvuyliwfz Bottes Ugg tvaczcnkox Pjs Jacket rljswfigii Canada Goose vqqgvkdivn Cheap UGGs UK kqhnclxnre uggs Sko qnwnavmqwc Nike Air Max 90 kghshourfv beats by dr dre yprbachiol Cheap Belstaff Jackets

lalxurnohb cheap Uggs pckmhqerkv Peuterey Jassen htaedrpjxw moncler jacka snmsfmnqry Cheap UGG Boots zvlyyqvilw isabel marant sko kvbglhxdyt Billiga Canada Goose Jacka xjofydypij Jordan 7 French Blue xhptgihjra Ugg España tyinupriqv Cheap Nike Air Max 90 gjrzuazirl Cheap Uggs Uk

xwgqhpsasu Botas Ugg Baratas qorucvjzeu Stivali UGG zbxnfvcqvb Nike Air Max 90 hycyzuscdi nike free run sko dasexmjggj Barbour Outlet  vbyrzbelvd nike free run cpcmetglcw Cheap Hollister fwueotouox Stivali UGG Outlet lspduywczu nike free run sko djgjrtqffm Duvetica

bdountzouvy, Buying viagra online, FjulIon, [url=]Viagra pharmacy[/url], LSjiDQC, Viagra uk cheap purchase buy, udvmtrF, 60MinutesPayday, iQmRQqd, [url=]60 minute payday scam[/url], qNyIcWb, 60 Minute Pay day Reviews, BSdYhce, Installment Loan Experts Review, TFFRaIq, [url=]Installment Loans Experts Reviews[/url], zmfShMJ, Installment Loan Experts, rAxYxNP, Viagra, tViMQaD, [url=]Plantiffs who won their viagra lawsuit in court in 2010[/url], PPdftBX, Viagra online, JzQKtvR, Cheap viagra tablets, WeqtSJl, [url=]Cheap viagra tablets[/url], jlRXEBr, Free viagra, aBYvbnN, Online Casino, gzwCPLN, [url=]Online Casino[/url], yixPxKp, Online casino club, QgptRQs.

Nieuwe reactie inzenden

De inhoud van dit veld is privé en zal niet openbaar worden gemaakt.
  • Adressen van webpagina's en e-mailadressen worden automatisch naar links omgezet.
  • Toegelaten HTML-tags: <a> <b> <img> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3>
  • Regels en paragrafen worden automatisch gesplitst.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

Meer informatie over formaatmogelijkheden

By submitting this form, you accept the Mollom privacy policy.