Core Packages


collective.geo.geographer has been documented on


This package includes OpenLayers framework in Plone.

You can include an Openlayers map in a page using a BrowserView or a Page template.

There is a simple integration example:

<html xmlns=""
    <metal:block metal:fill-slot="style_slot">
        <style type="text/css">
          #map {
              width: 100%;
              height: 500px;
              border: 1px solid black;
              position: relative

    <metal:block metal:fill-slot="javascript_head_slot">
      <script type="text/javascript">
          (function ($) {
            var map;
            jq(window).load(function() {
              map = new OpenLayers.Map('map');
              var wms = new OpenLayers.Layer.WMS(
                              "OpenLayers WMS",
                              {layers: 'basic'}
              mousecontrol = new OpenLayers.Control.MousePosition(),

              map.setCenter(new OpenLayers.LonLat(7, 45), 3);

        // -->
    <metal:content fill-slot="content-core">
        <metal:content define-macro="content-core">
          <div id="map" class="olMap">
            <!-- openlayers map -->

For more informations about OpenLayers see:


This package provides some utilities to store settings used in collective.geo packages.

Settings are stored in Plone registry and they provide default values to map widgets.

They are split in two different interfaces:

  • IGeoSettings for map settings, like default map layers, center, zoom etc.
  • IGeoFeatureStyle for map style like lines and polygon colors, marke image etc.

For more details see: collective.geo.settings.interfaces

You can retrieve settings by API:

from zope.component import getUtility

from plone.registry.interfaces import IRegistry
from collective.geo.settings.interfaces import IGeoSettings
registry = getUtility(IRegistry)
settings = registry.forInterface(IGeoSettings)

from collective.geo.settings.interfaces import IGeoFeatureStyle
styles = registry.forInterface(IGeoSettings)

or using some utilities:

from collective.geo.settings.utils import geo_settings
settings = geo_settings()

from collective.geo.settings.utils import geo_styles
styles = geo_settings()

Coordinate field

collective.geo.settings defines a field type ‘Coordinate’ useful to define a coordinate attribute in Zope Interface and use it in forms.

You can define an interface in this way:

import decimal
from zope.interface import Interface
from collective.geo.settings.schema import Coordinate

class IGeoSettings(Interface):
    longitude = Coordinate(



from zope.interface import Interface
from zope import schema

from z3c.form import form, field
from collective.z3cform.mapwidget.widget import MapFieldWidget

class IMyForm(Interface):
    wkt = schema.Text(
        title=u"Shape in WKT format"

class GeoShapeForm(form.Form):
    fields = field.Fields(IMyManager)
    fields['wkt'].widgetFactory = MapFieldWidget