Adapt modules for OpenLayers 7.x-2.0-beta4 and future versions

Last updated on
30 April 2025

Affected modules

Projection support was introduced between 7.x-2.0-beta3 and 7.x-2.0-beta4 of the OpenLayers module. In order to work towards cleaner code it was chosen to require providers of extensions to the OpenLayers module to adapt their layer and map definitions.

Rationale

There are various authorities/organizations who define projections. Thus there was the need to provide the authorities names in order to prevent ambiguities.

Required changes

Third party layers and maps need to be updated so that they use authority codes whenever they mention a projection.

Old code lacking authority code

// Fragment of a layer
$layer->data = array(
  …
  'projection' => array(4326),
  …
);

// Fragment of a map
$openlayers_maps->data = array(
  …
  'projection' => 3857,
  'displayProjection' => 4326,
  …
);

New code with authority codes

// Fragment of a layer
$layer->data = array(
  …
  'projection' => array('EPSG:4326'),
  …
);

// Fragment of a map
$openlayers_maps->data = array(
  …
  'projection' => 'EPSG:3857',
  'displayProjection' => 'EPSG:4326',
  …
);

Help improve this page

Page status: Not set

You can: