OpenLayers 2.0-Alpha1 Drupal Module Released
Advances in administration, performance, and extensibility for a better mapping platform
OpenLayers 2.0-alpha1 has been released, and there is a clear upgrade path from both 0.x and 1.x. I want to share some advances for administration, performance, and extensibility that have been made during the past couple months to give everyone a sense of what this means for Drupal as a serious mapping platform. For those new to the OpenLayers module, it's an interface that works with the OpenLayers javascript library to provide interactive maps similar to the Google Maps API, but with a completely open source stack and many more opportunities for customization.

Administration improvements: We are working to make it easier to add custom tiles. The user interface has become more thorough - new layers like OpenStreetMap, MapBox, CloudMade, and Google Maps can be added through the administration interface. Styles can also be defined all within Drupal and presented on an OpenLayers map on your website. Details that make hyper-local mapping and specialized apps like Managing News possible are now configurable in the user interface - select the allowed area of a map by simply shift-clicking and dragging a box over a map, and select the location and bounding box of a new place by clicking and dragging in the Geo Taxonomy interface. We are working now on better documenting this too.
Putting data on the map: Beyond the many options of layers you can bring into an OpenLayers map, the module also supports a variety of data sources that can be overlaid. A view or multiple views can show Drupal data, and the OpenLayers CCK and Spatial Tools modules can bring complex points, lines, and polygons into Drupal's system. OpenLayers also integrates seamlessly with Geo Taxonomy to display places and show listings of points at each place, which is how it is used in Managing News.
Extensibility: All new functionality in OpenLayers is powered by generic add-ons - layers, styles, behaviors, and presets are all modular and ready to be included in a new feature or just exported to code for easy deployment. This also means that the ability to extend the OpenLayers module is extremely strong - the MapBox Module provides an interface to add new MapBox layers, as well as, instantly, the Maki icon set as perfectly styled, pluggable icons for OpenLayers maps.
Performance: We switched the way that views is invoked in openlayers_views so that the output of OpenLayers data can be cached correctly. This is big for maps with lots of points. The module now uses the built-in function for encoding points on maps so the initial generation of the points data (or the generation during stuff like faceted search) is much faster. The module + MapBox module now default to a setting buffer - 0 on layers - to make sure that the map loads layers that are in view first. In the past, often layers on the boundary or out of view were loaded first, making it less snappy. If you still want more out of Open Layers, you can do a custom build of OpenLayers.js, which reduces its filesize by half or more. For example on Managing News, our OpenLayers.js is now 332K, down from 840K. The OpenLayers build system makes this possible, and with its simple utility you can build your own version with your own requirements.
We are working on documenting much of this work. In addition to working on inline documentation, we also posted new documentation on the Drupal.org OpenLayers book. Looking a couple months out, our main focus is on stability :) We'll also be working on:
- Previews for maps, styles, and layers in the admin
- Easy interface for uploading and creating new icon styles
- Import of presets, layers, and styles
- Replacement of Drupal behaviors system with our own
- Unification of baselayers and overlays management
Dealing with point data
Hi guys. First of all, great work on OpenLayers 2, looks great and I’m excited to give it a go.
Since you guys seem to be the foremost experts on all things Drupal+Mapping, I was hoping to pose a question to you regarding data and geocoding. I’m currently using a combination of Location+Views+GMap to handle my mapping. It works okay however maintaining Location is becoming a bit of a headache as I’ve currently got several user-submitted patches applied and I’m not sure when or if they’ll ever be applied to Location by the developers. In addition to this, I’d like to move away from GMap and towards OpenLayers.
There are two facets for my dependence on Locations, namely geocoding and proximity filtering. I see OpenLayers Geocoder is available, so I think that will take care of my geocoding requirement. However, is there any thing in the OpenLayers stack or related modules that does anything like proximity filtering? Ideally I’d like to be able to pass arguments to a view, a lat,lon point and a distance, and receive back a set of nodes to be plotted on a map or displayed.
Anyway, thanks again, and I appreciate any advice and the work done on OpenLayers.
Upcoming Feature
This is definitely going to be included in 2.x, but the approach to the new version was to scale back to a stable, flexible core and then building out to a full feature set. Here's the ticket for this new functionality.
Upgrade from 1.x is NOT clear.
Just to clarify there, currently, there is no upgrade path from the 1.x branch to the 2.x branch. This needs a fair amount of work.
No automatic path
Indeed from 1.x to 2.x, there is a manual upgrade process, which is documented in the OpenLayers Drupal book, but the concepts have changed vastly so in some cases it is necessary to build your maps in the new system. Though conversely to say that there isn’t an upgrade path isn’t true; the schema upgrading is handled properly between 0, 1, and 2.
Woot! So much mapping
Woot! So much mapping awesomeness. Thanks for all the hard work Tom. Just a note: Spatial Tools is written for OpenLayers 1.0, and will not work for OpenLayers 2.0 – I hope to remedy this soonish.
Great work
Yes, thank you Tom for putting in so much time and making the OpenLayers module awesome!
Great – I’ve looked at the
Great – I’ve looked at the work in Spatial Tools and am really excited about what it sets out to do.