You are here

function openlayers_get_extent in Openlayers 6.2

Same name and namespace in other branches
  1. 7.2 openlayers.module \openlayers_get_extent()

Get extent given projection

Returns standard world-max-extents for common projections. Layers implementing other projections and subsets of the world should define their maxExtent in the layer array.

Parameters

$projection: String of the projection value. Currently supports 900913, 4326.

Return value

Array of maxExtent in OpenLayers toArray() format.

10 calls to openlayers_get_extent()
hook_openlayers_presets in docs/openlayers.api.php
OpenLayers Presets
openlayers_layer_type_google::options_init in includes/layer_types/google.inc
Provide initial values for options.
openlayers_layer_type_maptiler::options_init in includes/layer_types/maptiler.inc
Provide initial values for options.
openlayers_layer_type_osm::options_init in includes/layer_types/osm.inc
Provide initial values for options.
openlayers_layer_type_tms::options_init in includes/layer_types/tms.inc
Provide initial values for options.

... See full list

File

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

Code

function openlayers_get_extent($projection) {
  switch ($projection) {
    case '900913':
      return array(
        -20037508,
        -20037508,
        20037508,
        20037508,
      );
    case '4326':
      return array(
        -180,
        -90,
        180,
        90,
      );
  }
}