You are here

function openlayers_ui_style_preview in Openlayers 7.2

Create Style Preview

Create a style preview given style object.

1 call to openlayers_ui_style_preview()
openlayers_styles_ui::list_build_row in modules/openlayers_ui/plugins/export_ui/openlayers_styles_ui.class.php
Build a row based on the item.

File

modules/openlayers_ui/openlayers_ui.module, line 320
Main Drupal module file for the OpenLayers UI module

Code

function openlayers_ui_style_preview($style, $crosshairs = FALSE) {
  drupal_add_js(drupal_get_path('module', 'openlayers_ui') . '/js/openlayers_ui.styles.js');
  drupal_add_css(drupal_get_path('module', 'openlayers_ui') . '/openlayers_ui.css');
  module_load_include('inc', 'openlayers', 'includes/openlayers.render');
  openlayers_include();

  // Let's make a tiny map for a preview
  drupal_add_js(array(
    'openlayers_ui' => array(
      'style_preview' => array(
        $style->name => $style,
        $style->name . '_crosshairs' => $crosshairs,
      ),
    ),
  ), 'setting');
  return theme('openlayers_ui_styles_preview', array(
    'style' => $style,
  ));
}