Skip to main content

Mapping - A Quick Intro to OpenLayers & Leaflet in Drupal 7

A nice overview presentation by levelos
- http://www.slideshare.net/loubabe/drupal-mapping-9713919

hands on notes

openlayers: big, slow, confusing but lots of features + flexibility
leaflet: small, fast, but little features and only a dev release
+ dasjo's great sandbox :) http://drupal.org/sandbox/dasjo/1408378

Get the required modules
openlayers: drush dl geofield libraries views features leaflet
leaflet: drush dl geofield libraries views features openlayers

Enable required modules
openlayers: drush en leaflet geofield views_ui field_ui
leaflet: drush en openlayers_views openlayers_ui geofield views_ui field_ui

Creating a basic formular with a map
= Create content type "place" that uses geofield to store a "location"
for field types see geofield_field_widget_info

Views
leaflet: create a view with the leaflet map format + some easy settings available
openlayers: the long story begins … :)

Add view
1) view -> add data overlay display
2) openlayers -> configure map that uses the data overlay
3) view -> add map page that displays the configured map

openlayers map options
-> add popup feature as behavior

openlayers custom layer example
- http://tiles.mapbox.com/mapbox/map/blue-marble-topo-jul-bw
embed link ->
- http://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-jul-bw.jsonp
openlayers - layers -> new TMS layer
- base url = http://a.tiles.mapbox.com/v3/
- layer name = mapbox.blue-marble-topo-jul-bw

Features
- openlayers demo map feature http://drupal.org/sandbox/dasjo/1433100
- leaflet demo map feature = part of my leaflet sandbox http://drupal.org/sandbox/dasjo/1408378

About
- this is reference material for a short presentation at drupal austria meetup in feb 2012
- http://www.drupal-austria.at/veranstaltungen/drupal-stammtisch-wien-feb…

Further info
- http://dasjo.at
- Upcoming thesis…
- Interactive Map Visualization Techniques for Open Data in Austria with Drupal
- http://www.xmind.net/share/das_jo/interactive-map-visualization-techniq…
- http://demo.austrofeedr.at/
- http://groups.drupal.org/node/207458
- http://austria.drupaldata.com/