Adapt modules for OpenLayers 7.x-2.0-beta4 and future versions
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
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
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion