function openlayers_get_projection_by_identifier in Openlayers 7.2
Parameters
String $identifier Identifier, such as “EPSG:4326”:
Return value
openlayers_projection
5 calls to openlayers_get_projection_by_identifier()
- openlayers_build_map in ./
openlayers.module - Prepare a map for rendering.
- openlayers_get_projection in ./
openlayers.module - openlayers_layer_type::getProjections in ./
openlayers.module - openlayers_maps_ui::edit_form in modules/
openlayers_ui/ plugins/ export_ui/ openlayers_maps_ui.class.php - Provide the actual editing form.
- openlayers_render_map_data in ./
openlayers.module - Render map array
File
- ./
openlayers.module, line 1059 - Main OpenLayers API File
Code
function openlayers_get_projection_by_identifier($identifier) {
ctools_include('export');
$records = ctools_export_load_object('openlayers_projections', 'names', array(
$identifier,
));
if (empty($records)) {
if (mb_strpos($identifier, ':') === FALSE) {
throw new Exception(t("Projection !projection lacks an authority code. Read http://drupal.org/node/1944074 for hints.", array(
'!projection' => $identifier,
)));
}
throw new Exception(t("Projection !projection requested but not supported.", array(
'!projection' => $identifier,
)));
}
return openlayers_projection_from_record($records[key($records)]);
}