This project is not covered by Drupal’s security advisory policy.

OpenLayers Styles provides a flexible mechanism to manage styles and apply variable styling in OpenLayers. This module is meant to perform two classes of tasks:

  • Use pluggable, automatic mechanisms to populate styles (e.g. from a folder of icons and a configuration file).
  • Override the default layer style to provide different styles for different features on the layer.

For the second task above, this module also provides a new field type for choosing OpenLayers styles. Depending on the widget used, the label of a style choice can be customized, e.g. as an icon so you can show a list of icons and click to choose!

The task of initially populating the styles can be accomplished using the provided plugin to load styles from an INI configuration file. The file can define any property that goes into an OpenLayers style configuration (including image file name, dimensions, anchor point).

How-to

A general recipe is to set up OpenLayers in the typical fashion, specifically with Views (there is an excellent tutorial). Then:

  1. Enable OpenLayers Styles and OpenLayers Styles CCK.
  2. Enable OpenLayers Styles UI (separately from OpenLayers Styles).
  3. Define some styles.
  4. Add an OpenLayers style field to the content type (containing geographical features) you wish to vary styles for.
  5. Add the field to the view providing OpenLayers Data.
  6. Enable the map preset behavior Named styles and enter the attribute name of the field added to the view.

For advanced style management, enable OpenLayers Styles UI to configure sources providing style configurations.

Documentation at this point is scarce. You are very welcome to contribute!

Requirements

  • CTools 1.7 (for the administrative UI)

Drupal 7

This module will be ported to Drupal 7 as soon as time becomes available. Co-maintainers are welcome!

Acknowledgments

Development of the Drupal 6 branch is partly sponsored by The Australian National University.

Project information

  • caution Seeking co-maintainer(s)
    Maintainers are looking for help reviewing issues.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Created by zhangtaihao on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases