Quantcast
Viewing all articles
Browse latest Browse all 426

Adapt modules for 7.x-2.0-beta4

Affected modules

Between 7.x-2.0-beta3 and 7.x-2.0-beta4 of the openlayers module projection support was introduced. 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 a 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

<?php
// 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

<?php
// 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',
 

);
?>

Viewing all articles
Browse latest Browse all 426

Trending Articles