openlayers_simple.inc in Openlayers 7.2
File
plugins/boxes/openlayers_simple.inc
View source
<?php
class openlayers_simple extends boxes_box {
public function options_defaults() {
return array(
'map' => '',
);
}
public function options_form(&$form_state) {
$form = array();
$form['map'] = array(
'#type' => 'select',
'#title' => t('Map'),
'#description' => t('This is map that will be used to render the view.'),
'#options' => openlayers_map_options(),
'#default_value' => $this->options['map'] ? $this->options['map'] : variable_get('openlayers_default_map', 'default'),
);
return $form;
}
public function render() {
$title = isset($this->title) ? check_plain($this->title) : NULL;
$map = openlayers_map_load($this->options['map']);
return array(
'delta' => $this->delta,
'title' => $title,
'subject' => $title,
'content' => openlayers_render_map($map, $map->name),
);
}
}