OpenLayers Plus

OpenLayers is a powerful mapping framework that allows you to create beautiful maps in a short amount of time. Recently, we have been working on an OpenLayers map for a client that requested "density circles," or a way to visually show concentration of projects within a region. I remembered Alan Palazzolo mentioning a project called "OpenLayers Plus" during his session at BadCamp back in the fall.

When I looked into Development Seed's OpenLayers Plus GitHub project I noticed that it was designed for Drupal 6, and this site was Drupal 7. After some help from Scott, I was able to use density circles on our map. Turns out, we only needed to change a few things to get it working in Drupal 7. Here are some step-by-step instruction on how to get OpenLayers Plus working in Drupal 7 (assumes you have already built your OpenLayers data layer with a view):

  1. Download the OpenLayers Plus module
  2. Change the .info file to use Drupal 7 as the core (core = "7.x")
  3. Enclosed all JavaScript functions with the ($) wrapper (we only made this update in openlayers_plus_behavior_scalepoints.js because that is the one behavior we wanted to use)
  4. Make sure your OpenLayers map is pointed to the correct OpenLayers data view under "Layers & Styles" in the OpenLayers module config.
  5. Make sure to check the new options you want under the "Behaviors" tab in the OpenLayers module config. They should be prefaced by "OL +"

Our view was using aggregation to count the number of projects per region. That value was served in the OpenLayers data view under a field called "nid." This is the value we entered for "Field" under the "OL + Scalepoints" options. You can find our source code in our sandbox project.

The end product shows density circles for each region:

* OpenLayers icon taken from Drupal.org

6 Comments

Thanks for this blog post. Are you planning to move this over to Drupal.org and host a full Drupal 7 version?

Hi Peter,

The sandbox project linked in the post is on Drupal.org. It's not a full Drupal 7 port yet, just the parts Brandon needed for this project.

Did you saw that?

https://github.com/developmentseed/openlayers_plus/tree/d7

Thanks for this tuto. Unfortunately, the module does not work properly on the website for which I work. I hope a stable version is released soon :-)

can you tell me the aggregate function you are using in views,that you gave to scale point ?

http://drupal.org/project/openlayers_plus

Add a comment

About the Author

Brandon Geiger

Interaction Developer

Brandon is a seasoned veteran in interactive and marketing initiatives, having won several national and international awards while working in three different national ad agencies. He's worked with an impressive list of former clients, including American Airlines, HP, IBM, Motorola, Nationwide Insurance, and Verizon. He has over ten years of experience delivering high-end interactive solutions and team management. Here at Aten Brandon's main focus is interactive solutions and usability. Brandon also likes cupcakes.

Read More Brandon's Blog Posts