function getlocations_map_display_options_form in Get Locations 7
Same name and namespace in other branches
- 6.2 getlocations.module \getlocations_map_display_options_form()
- 6 getlocations.module \getlocations_map_display_options_form()
- 7.2 getlocations.module \getlocations_map_display_options_form()
Function
Return value
Returns form
6 calls to getlocations_map_display_options_form()
- getlocations_fields_field_formatter_settings_form in modules/
getlocations_fields/ getlocations_fields.module - Implements hook_field_formatter_settings_form(). Returns form elements for a formatter's settings.
- getlocations_fields_field_settings_form in modules/
getlocations_fields/ getlocations_fields.module - Implements hook_field_settings_form(). Add settings to a field settings form.
- getlocations_map_field_formatter_settings_form in modules/
getlocations_map/ getlocations_map.module - Implements hook_field_formatter_settings_form(). Returns form elements for a formatter's settings.
- getlocations_plugin_style_map::options_form in views/
getlocations_plugin_style_map.inc - Provide a form to edit options for this plugin.
- getlocations_settings_form in ./
getlocations.admin.inc - Function to display the getlocations admin settings form
File
- ./
getlocations.module, line 4162 - getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function getlocations_map_display_options_form($defaults, $config = TRUE, $extras = TRUE, $source = '') {
$controlpositions = getlocations_controlpositions();
$form = array();
$form['controltype'] = getlocations_element_map_zoom_controltype($defaults['controltype']);
$form['controltype']['#suffix'] = '<div id="wrap-getlocations-zoomcontrol">';
$form['zoomcontrolposition'] = getlocations_element_dd(t('Position of Zoom Control'), $defaults['zoomcontrolposition'], $controlpositions);
$form['zoomcontrolposition']['#suffix'] = '</div>';
$form['pancontrol'] = getlocations_element_map_checkbox(t('Show Pan control'), $defaults['pancontrol']);
$form['pancontrol']['#suffix'] = '<div id="wrap-getlocations-pancontrol">';
$form['pancontrolposition'] = getlocations_element_dd(t('Position of Pan Control'), $defaults['pancontrolposition'], $controlpositions);
$form['pancontrolposition']['#suffix'] = '</div>';
$form['mtc'] = getlocations_element_map_mtc($defaults['mtc']);
$form['mtc']['#suffix'] = '<div id="wrap-getlocations-mapcontrol">';
$form['mapcontrolposition'] = getlocations_element_dd(t('Position of Map Control'), $defaults['mapcontrolposition'], $controlpositions);
$form['mapcontrolposition']['#suffix'] = '</div>';
$getlocations_defaults = getlocations_defaults();
// get baselayers in
$baselayers = $getlocations_defaults['baselayers'];
foreach ($baselayers as $k => $v) {
if (!isset($defaults['baselayers'][$k])) {
$defaults['baselayers'][$k] = $v;
}
}
// make sure at least one layer is set
$found = FALSE;
foreach ($defaults['baselayers'] as $key => $value) {
if ($value) {
$found = TRUE;
}
}
if (!$found) {
$defaults['baselayers']['Map'] = 1;
$defaults['maptype'] = 'Map';
}
// backward compat
if (isset($defaults['baselayers']['OpenStreetMap'])) {
$defaults['baselayers']['OSM'] = $defaults['baselayers']['OpenStreetMap'];
unset($defaults['baselayers']['OpenStreetMap']);
}
$form['maptype'] = getlocations_element_map_maptype($defaults['maptype'], $defaults['baselayers']);
$form['baselayers'] = array(
'#type' => 'fieldset',
'#title' => t('Enable map types'),
'#description' => t('Select which maps you want to be available.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
foreach ($defaults['baselayers'] as $key => $value) {
$layer = getlocations_element_map_baselayers($key, $value);
if ($layer) {
$form['baselayers'][$key] = $layer;
}
}
$form['scale'] = getlocations_element_map_checkbox(t('Scale'), $defaults['scale'], t('Show scale.'));
$form['scale']['#suffix'] = '<div id="wrap-getlocations-scale">';
$form['scalecontrolposition'] = getlocations_element_dd(t('Position of Scale Control'), $defaults['scalecontrolposition'], $controlpositions);
$form['scalecontrolposition']['#suffix'] = '</div>';
$form['overview'] = getlocations_element_map_checkbox(t('Overview map'), $defaults['overview'], t('Show overview map.'));
$form['overview']['#suffix'] = '<div id="wrap-getlocations-overview">';
$form['overview_opened'] = getlocations_element_map_checkbox(t('Overview map state'), $defaults['overview_opened'], t('Show overview map as open by default.'));
$form['overview_opened']['#suffix'] = '</div>';
$form['scrollwheel'] = getlocations_element_map_checkbox(t('Scrollwheel'), $defaults['scrollwheel'], t('Enable scrollwheel zooming.'));
$form['draggable'] = getlocations_element_map_checkbox(t('Draggable'), $defaults['draggable'], t('Enable dragging the map.'));
$form['nokeyboard'] = getlocations_element_map_checkbox(t('Disable keyboard shortcuts'), $defaults['nokeyboard'], t('Enabling this will disable keyboard shortcuts on the map.'));
$form['nodoubleclickzoom'] = getlocations_element_map_checkbox(t('Disable Doubleclick zoom'), $defaults['nodoubleclickzoom'], t('Enabling this will disable doubleclick zooming on the map.'));
$form['map_backgroundcolor'] = getlocations_element_map_tf(t('Map background color'), $defaults['map_backgroundcolor'], t('Can be a color name or HTML hex, eg #FF0000. Leave empty for the default color.'), 10);
if ($config) {
$form['region_bias'] = getlocations_element_dd(t('Regional bias'), $defaults['region_bias'], array(
'' => t('None'),
) + getlocations_get_countries_list(), t('Bias the maps to a particular country'));
// jquery_colorpicker
if (module_exists('jquery_colorpicker')) {
$form['jquery_colorpicker_enabled'] = getlocations_element_map_checkbox(t('Use jQuery Colorpicker'), $defaults['jquery_colorpicker_enabled'], t('Use the jQuery Colorpicker for selecting colors.'));
}
else {
$form['jquery_colorpicker_enabled'] = array(
'#type' => 'value',
'#value' => 0,
);
}
$form['is_https'] = getlocations_element_map_checkbox(t('Force https maps'), $defaults['is_https']);
}
if ($extras) {
// getlocations_gps
if (module_exists('getlocations_gps')) {
$form += getlocations_gps_map_display_options_form($defaults);
$form['geolocation_mobile_check'] = array(
'#type' => 'checkbox',
'#title' => t('Enable check for mobiles'),
'#default_value' => $defaults['geolocation_mobile_check'],
'#return_value' => 1,
'#description' => t('Enable geolocation for mobile devices only.'),
);
}
else {
$form['geolocation_mobile_check'] = array(
'#type' => 'value',
'#value' => 0,
);
}
// getlocations_smartip
if (module_exists('getlocations_smartip')) {
$form += getlocations_smartip_map_display_options_form($defaults);
}
$form['sv_show'] = getlocations_element_map_checkbox(t('Show streetview Pegman'), $defaults['sv_show']);
$form['sv_show']['#suffix'] = '<div id="wrap-getlocations-sv-show">';
$form['svcontrolposition'] = getlocations_element_dd(t('Position of Pegman'), $defaults['svcontrolposition'], $controlpositions);
$form['svcontrolposition']['#suffix'] = '</div>';
// show_maplinks
$form['show_maplinks'] = getlocations_element_map_checkbox(t('Show map links'), $defaults['show_maplinks'], t('Show a list of links to popup InfoWindow/InfoBubble/Link on the map.'));
$form['show_maplinks']['#suffix'] = '<div id="wrap-getlocations-maplinks">';
$form['show_maplinks_viewport'] = getlocations_element_map_checkbox(t('Only Show map links in Viewport'), $defaults['show_maplinks_viewport']);
$form['show_maplinks_viewport']['#suffix'] = '</div>';
$form['show_bubble_on_one_marker'] = getlocations_element_map_checkbox(t('Show bubble automatically'), $defaults['show_bubble_on_one_marker'], t('Have the InfoWindow/InfoBubble popup automatically if there is only one marker on the map.'));
$form['fullscreen'] = getlocations_element_map_checkbox(t('Show Fullscreen button'), $defaults['fullscreen']);
$form['fullscreen']['#suffix'] = '<div id="wrap-getlocations-fs-show">';
$form['fullscreen_controlposition'] = getlocations_element_dd(t('Position of Fullscreen button'), $defaults['fullscreen_controlposition'], $controlpositions);
$form['fullscreen_controlposition']['#suffix'] = '</div>';
$form['trafficinfo'] = getlocations_element_map_checkbox(t('Enable Traffic information'), $defaults['trafficinfo'], t('Google Traffic layer, limited availability.'));
$form['trafficinfo']['#suffix'] = '<div id="wrap-getlocations-trafficinfo">';
$form['trafficinfo_state'] = getlocations_element_map_checkbox(t('Activate Traffic information'), $defaults['trafficinfo_state'], t('Activate Traffic layer when map is first displayed.'));
$form['trafficinfo_state']['#suffix'] = '</div>';
$form['bicycleinfo'] = getlocations_element_map_checkbox(t('Enable Bicycling information'), $defaults['bicycleinfo'], t('Google Bicycling layer, limited availability.'));
$form['bicycleinfo']['#suffix'] = '<div id="wrap-getlocations-bicycleinfo">';
$form['bicycleinfo_state'] = getlocations_element_map_checkbox(t('Activate Bicycle information'), $defaults['bicycleinfo_state'], t('Activate Bicycling layer when map is first displayed.'));
$form['bicycleinfo_state']['#suffix'] = '</div>';
$form['transitinfo'] = getlocations_element_map_checkbox(t('Enable Public transport information'), $defaults['transitinfo'], t('Google Transit layer, limited availability.'));
$form['transitinfo']['#suffix'] = '<div id="wrap-getlocations-transitinfo">';
$form['transitinfo_state'] = getlocations_element_map_checkbox(t('Activate Public transport information'), $defaults['transitinfo_state'], t('Activate Transit layer when map is first displayed.'));
$form['transitinfo_state']['#suffix'] = '</div>';
$form['poi_show'] = getlocations_element_map_checkbox(t('Show Points of Interest'), $defaults['poi_show'], t('Show Google points of interest icons.'));
$form['transit_show'] = getlocations_element_map_checkbox(t('Show Transit Points'), $defaults['transit_show'], t('Show Google transit points icons.'));
$form += getlocations_shapes_form($defaults, $source);
$form += getlocations_kml_form($defaults);
$form += getlocations_geojson_form($defaults);
$form += getlocations_highlight_form($defaults);
$form += getlocations_geocoder_form($defaults);
$form += getlocations_google_places_form($defaults, $config);
$form += getlocations_what3words_form($defaults);
if ($config) {
$form['places'] = array(
'#type' => 'value',
'#value' => $defaults['places'],
);
}
}
return $form;
}