function geofield_map_settings_form in Geofield 7
Same name and namespace in other branches
- 7.2 modules/geofield_map/geofield_map.module \geofield_map_settings_form()
2 calls to geofield_map_settings_form()
- geofield_map_field_formatter_settings_form in modules/
geofield_map/ geofield_map.module - Implements hook_field_formatter_settings_form().
- geofield_map_plugin_style_map::options_form in modules/
geofield_map/ includes/ geofield_map_plugin_style_map.inc - Options form
File
- modules/
geofield_map/ geofield_map.module, line 171
Code
function geofield_map_settings_form($settings, $element = array()) {
$element['geofield_map_width'] = array(
'#type' => 'textfield',
'#title' => t('Map width'),
'#default_value' => $settings['geofield_map_width'],
'#size' => 25,
'#maxlength' => 25,
'#description' => t('The default width of a Google map, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'),
'#required' => TRUE,
);
$element['geofield_map_height'] = array(
'#type' => 'textfield',
'#title' => t('Map height'),
'#default_value' => $settings['geofield_map_height'],
'#size' => 25,
'#maxlength' => 25,
'#description' => t('The default height of a Google map, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'),
'#required' => TRUE,
);
$element['geofield_map_zoom'] = array(
'#type' => 'select',
'#title' => t('Zoom'),
'#default_value' => $settings['geofield_map_zoom'],
'#options' => drupal_map_assoc(range(0, 17)),
'#description' => t('The default zoom level of a Google map.'),
);
$element['geofield_map_controltype'] = array(
'#type' => 'select',
'#title' => t('Zoom Control Type'),
'#options' => array(
'none' => t('None'),
'default' => t('Default'),
'small' => t('Small'),
'large' => t('Large'),
),
'#default_value' => $settings['geofield_map_controltype'],
);
$element['geofield_map_mtc'] = array(
'#type' => 'select',
'#title' => t('Map Control Type'),
'#options' => array(
'none' => t('None'),
'standard' => t('Horizontal bar'),
'menu' => t('Dropdown'),
),
'#default_value' => $settings['geofield_map_mtc'],
);
$element['geofield_map_pancontrol'] = array(
'#type' => 'checkbox',
'#title' => t('Show Pan control'),
'#default_value' => $settings['geofield_map_pancontrol'],
'#return_value' => 1,
);
$mapopts = array(
'map' => t('Standard street map'),
);
if ($settings['geofield_map_baselayers_satellite']) {
$mapopts['satellite'] = t('Standard satellite map');
}
if ($settings['geofield_map_baselayers_hybrid']) {
$mapopts['hybrid'] = t('Hybrid satellite map');
}
if ($settings['geofield_map_baselayers_physical']) {
$mapopts['physical'] = t('Terrain map');
}
$element['geofield_map_maptype'] = array(
'#type' => 'select',
'#title' => t('Default Map Type'),
'#default_value' => $settings['geofield_map_maptype'],
'#options' => array(
'map' => t('Standard street map'),
'satellite' => t('Standard satellite map'),
'hybrid' => t('Hybrid satellite map'),
'physical' => t('Terrain map'),
),
);
$element['geofield_map_baselayers_map'] = array(
'#type' => 'checkbox',
'#title' => t('Standard street map'),
'#description' => t('The standard default street map.'),
'#default_value' => $settings['geofield_map_baselayers_map'],
'#return_value' => 1,
'#prefix' => '<fieldset><legend>' . t('Enable map types') . '</legend>',
);
$element['geofield_map_baselayers_satellite'] = array(
'#type' => 'checkbox',
'#title' => t('Standard satellite map'),
'#description' => t('Satellite view without street overlay.'),
'#default_value' => $settings['geofield_map_baselayers_satellite'],
'#return_value' => 1,
);
$element['geofield_map_baselayers_hybrid'] = array(
'#type' => 'checkbox',
'#title' => t('Hybrid satellite map'),
'#description' => t('Satellite view with street overlay.'),
'#default_value' => $settings['geofield_map_baselayers_hybrid'],
'#return_value' => 1,
);
$element['geofield_map_baselayers_physical'] = array(
'#type' => 'checkbox',
'#title' => t('Terrain map'),
'#description' => t('Map with physical data (terrain, vegetation.)'),
'#default_value' => $settings['geofield_map_baselayers_physical'],
'#return_value' => 1,
'#suffix' => '</fieldset>',
);
$element['geofield_map_scale'] = array(
'#type' => 'checkbox',
'#title' => t('Scale'),
'#description' => t('Show scale'),
'#default_value' => $settings['geofield_map_scale'],
'#return_value' => 1,
);
$element['geofield_map_overview'] = array(
'#type' => 'checkbox',
'#title' => t('Overview map'),
'#description' => t('Show overview map'),
'#default_value' => $settings['geofield_map_overview'],
'#return_value' => 1,
);
$element['geofield_map_overview_opened'] = array(
'#type' => 'checkbox',
'#title' => t('Overview map state'),
'#description' => t('Show overview map as open by default'),
'#default_value' => $settings['geofield_map_overview_opened'],
'#return_value' => 1,
);
$element['geofield_map_scrollwheel'] = array(
'#type' => 'checkbox',
'#title' => t('Scrollwheel'),
'#description' => t('Enable scrollwheel zooming'),
'#default_value' => $settings['geofield_map_scrollwheel'],
'#return_value' => 1,
);
$element['geofield_map_draggable'] = array(
'#type' => 'checkbox',
'#title' => t('Draggable'),
'#description' => t('Enable dragging on the map'),
'#default_value' => $settings['geofield_map_draggable'],
'#return_value' => 1,
);
$element['geofield_map_streetview_show'] = array(
'#type' => 'checkbox',
'#title' => t('Show streetview button'),
'#default_value' => $settings['geofield_map_streetview_show'],
'#return_value' => 1,
);
return $element;
}