function openlayers_ui_get_projection_options in Openlayers 7.2
Same name and namespace in other branches
- 6.2 modules/openlayers_ui/openlayers_ui.module \openlayers_ui_get_projection_options()
Get projection options.
Return value
Array of projection options suitable for use in a FormAPI element.
3 calls to openlayers_ui_get_projection_options()
- openlayers_behavior_overviewmap::options_form in plugins/behaviors/ openlayers_behavior_overviewmap.inc 
- openlayers_maps_ui::edit_form in modules/openlayers_ui/ plugins/ export_ui/ openlayers_maps_ui.class.php 
- Provide the actual editing form.
- openlayers_ui_maps_form_center_map in modules/openlayers_ui/ includes/ openlayers_ui.maps.inc 
- Create Centering Map
File
- modules/openlayers_ui/ openlayers_ui.module, line 202 
- Main Drupal module file for the OpenLayers UI module
Code
function openlayers_ui_get_projection_options() {
  $options = array();
  foreach (openlayers_layers_load() as $key => $layer) {
    if (!empty($layer)) {
      foreach ($layer
        ->getProjections() as $projection) {
        $options[$projection->identifier] = $projection;
      }
    }
    else {
      watchdog('OpenLayers UI', "OpenLayers UI tried to load an empty Layer [@key] Projections Options Loading Skipped for this layer.", [
        "@key" => $key,
      ], WATCHDOG_WARNING);
    }
  }
  return $options;
}