You are here

function getlocations_search_js_settings_do in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_search/getlocations_search.module \getlocations_search_js_settings_do()

Parameters

array $defaults: Settings

string $mapid: Unique map identifier used in javascript to allow multiple maps

1 call to getlocations_search_js_settings_do()
getlocations_search_getmap in modules/getlocations_search/getlocations_search.module
Set up the map and use getlocations to spit it out

File

modules/getlocations_search/getlocations_search.module, line 370
getlocations_search.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_search_js_settings_do($defaults, $mapid) {
  $do_lookup = getlocations_search_do_types();
  $settings = array(
    $mapid => array(
      'method' => $defaults['method'],
      'maxzoom' => $defaults['maxzoom'],
      'do_lookup' => $do_lookup ? 1 : 0,
      'autocomplete_bias' => $defaults['autocomplete_bias'],
      'restrict_by_country' => $defaults['restrict_by_country'],
      'country' => $defaults['country'],
      'show_distance' => $defaults['show_distance'],
      'search_marker' => $defaults['search_marker'],
      'do_search_marker' => $defaults['do_search_marker'],
      'search_marker_toggle' => $defaults['search_marker_toggle'],
      'search_marker_toggle_active' => $defaults['search_marker_toggle_active'],
      'search_info_path' => url("getlocations_search/info"),
      'search_radshape_enable' => $defaults['search_radshape_enable'],
      'search_radshape_strokecolor' => $defaults['search_radshape_strokecolor'],
      'search_radshape_strokeopacity' => $defaults['search_radshape_strokeopacity'],
      'search_radshape_strokeweight' => $defaults['search_radshape_strokeweight'],
      'search_radshape_fillcolor' => $defaults['search_radshape_fillcolor'],
      'search_radshape_fillopacity' => $defaults['search_radshape_fillopacity'],
      'search_radshape_toggle' => $defaults['search_radshape_toggle'],
      'search_radshape_toggle_active' => $defaults['search_radshape_toggle_active'],
      'search_distance_type' => $defaults['search_distance_type'],
      'zoom_on_single_use' => $defaults['zoom_on_single_use'],
      'display_accuracy' => $defaults['display_accuracy'],
      'showall' => $defaults['showall'],
      'display_geo_microformat' => $defaults['display_geo_microformat'],
    ),
  );
  drupal_add_js(array(
    'getlocations_search' => $settings,
  ), 'setting');
}