You are here

function openlayers_get_default_map in Openlayers 6

Get Default Map

Gets default map as determined by admin setting

Parameters

$reset: Boolean whether get cached version or not

Return value

Map array

Related topics

4 calls to openlayers_get_default_map()
openlayers_filters_filter in modules/openlayers_filters/openlayers_filters.module
Implementation of hook_filter().
openlayers_presets_ui_presets_manage_add in modules/openlayers_presets_ui/includes/openlayers_presets_ui.ui.inc
Menu Callback for Add Preset
openlayers_render_map in ./openlayers.module
Render Map
_openlayers_cck_render_element_map in modules/openlayers_cck/openlayers_cck.module
Render Map for Widget

File

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

Code

function openlayers_get_default_map($reset = FALSE) {
  static $preset = array();
  static $searched = FALSE;
  if (!$searched || $reset) {

    // Get preset
    $preset = openlayers_get_preset(variable_get('openlayers_default_preset', 'default'));

    // If for some reason, we still dont have a map
    // try to get just default
    if (empty($preset)) {
      $preset = openlayers_get_preset('default');
    }
    $searched = TRUE;
  }

  // Return map data
  return $preset['preset_data'];
}