OpenLayers WKT CCK Field

Last updated on
30 April 2025

The following are instructions on how to create a OpenLayers WKT CCK Field.

Please note that this method of storing geographical information is not very robust, but works decently for basic needs. If you need more flexible methods of storing geographical information, please consider using Geo.

  1. Install the OpenLayers CCK module that comes with the OpenLayers module.
  2. Add a new OpenLayers map preset (or use existing one if more appropriate).
    1. Go to: admin/build/openlayers/presets/add
    2. Depending on your needs, it may make sense to start the map at a specific point and zoom
    3. If you want to add more functionality and style options, you can do so via the “Behaviours” and “Layers & Styles” tabs, such as using different map tile layers and configuring the map UI elements. Please see the Getting Started with OpenLayers for more in depth information.
    4. Please note that in order to style the input features, set the Default Style for the whole map.
  3. Add a new field to a content type. (see CCK for more detailed information on fields).
    1. Choose an OpenLayers WKT field and the OpenLayers Map widget.
    2. For the Input Map Preset, choose the map preset created above. Although not enabled by default, in most cases it probably makes sense to use the Zoom to Layer option; this will make sure that when viewing the node, the map will be showing the added point in the center.
    3. Under Global Settings, choose the usual field settings, and also Feature Types which will determine what kind of features can be inputted into this field.
    4. Go to the Formatters for the field to choose how to display this field when viewing the node.
  4. Go to the add a node of the type that you added the field to. You will see an interactive map to input features on. The below example only had points enabled for the types of features to add.

Help improve this page

Page status: Not set

You can: