You are here

function openlayers_add_js_projection_definition in Openlayers 7.2

Load projection transformations in case OpenLayers does not support projections in use natively

Parameters

openlayers_projection $projection:

2 calls to openlayers_add_js_projection_definition()
openlayers_render_map_data in ./openlayers.module
Render map array
openlayers_ui_maps_form_center_map in modules/openlayers_ui/includes/openlayers_ui.maps.inc
Create Centering Map

File

./openlayers.module, line 338
Main OpenLayers API File

Code

function openlayers_add_js_projection_definition(openlayers_projection $projection) {
  $openlayers_natively_supported = array(
    'EPSG:4326',
    'EPSG:900913',
  );

  // Only load Proj4js if projection not supported by OpenLayers anyway
  if (!in_array($projection->identifier, $openlayers_natively_supported)) {
    proj4js_load_definition($projection->identifier, $projection
      ->getDefinition());
  }
}