You are here

function getlocations_element_map_maptype in Get Locations 7

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_element_map_maptype()
  2. 6 getlocations.module \getlocations_element_map_maptype()
  3. 7.2 getlocations.module \getlocations_element_map_maptype()

Function

Return value

Returns form element

1 call to getlocations_element_map_maptype()
getlocations_map_display_options_form in ./getlocations.module
Function

File

./getlocations.module, line 3496
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_element_map_maptype($default, $baselayers) {
  $options = array();
  $providers = getlocations_get_map_providers();
  $layers = array();
  foreach ($providers as $k => $v) {
    $layers[$k] = $v['title'];
  }
  foreach ($layers as $key => $layer) {
    if (isset($baselayers[$key]) && $baselayers[$key]) {
      $options[$key] = $layer;
    }
  }
  $element = array(
    '#type' => 'select',
    '#title' => t('Default map type'),
    '#options' => $options,
    '#default_value' => $default,
  );
  return $element;
}