You are here

function openlayers_layer_type_cloudmade::render in Openlayers 7.2

Same name and namespace in other branches
  1. 6.2 includes/layer_types/cloudmade.inc \openlayers_layer_type_cloudmade::render()

Render.

Overrides openlayers_layer_type::render

File

plugins/layer_types/openlayers_layer_type_cloudmade.inc, line 73
OpenLayers CloudMade layer type

Class

openlayers_layer_type_cloudmade
OpenLayers CloudMade Layer Type class

Code

function render(&$map) {
  static $cloudmade_maps_included;
  if (!isset($cloudmade_maps_included)) {
    drupal_add_js(drupal_get_path('module', 'openlayers') . '/plugins/layer_types/openlayers_layer_type_cloudmade.js');
    $path = variable_get('openlayers_layers_cloudmade_js', '');
    if (valid_url($path, TRUE)) {

      // TODO: could be collapsed, removing the if-else
      drupal_add_js($path, 'external');
    }
    else {
      drupal_add_js($path);
    }
    $cloudmade_maps_included = TRUE;
  }
}