You are here

function getlocations_setlocations in Get Locations 7

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

Set up javascript settings and map

Parameters

array $latlons:

array $minmaxes:

string $type:

object $node:

string $width:

string $height:

Return value

string themed map html

8 calls to getlocations_setlocations()
getlocations_commentmap in ./getlocations.module
Page callback: Displays a map.
getlocations_lids in ./getlocations.module
Page callback: Displays a map.
getlocations_nids in ./getlocations.module
Page callback: Displays a map.
getlocations_nodemap in ./getlocations.module
Page callback: displays a map.
getlocations_termmap in ./getlocations.module
Page callback: Displays a map.

... See full list

File

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

Code

function getlocations_setlocations($latlons, $minmaxes = '', $type = 'node', $node = '', $extras = '', $width = '', $height = '') {
  if (!getlocations_defaults_check()) {
    return t('You need to !c first.', array(
      '!c' => l('Configure Getlocations', 'admin/config/services/getlocations'),
    ));
  }
  $getlocations_defaults = getlocations_defaults();
  $module = getlocations_get_current_supported_module();

  // sv
  if ($extras) {
    if ($module == 'getlocations_fields') {
      if (getlocations_fields_streetview_settings_allow()) {
        $getlocations_defaults['sv_heading'] = $extras['sv_heading'];
        $getlocations_defaults['sv_zoom'] = $extras['sv_zoom'];
        $getlocations_defaults['sv_pitch'] = $extras['sv_pitch'];
        $getlocations_defaults['sv_showfirst'] = $extras['sv_showfirst'];
        $getlocations_defaults['sv_addresscontrol'] = $extras['sv_addresscontrol'];
        $getlocations_defaults['sv_addresscontrolposition'] = $extras['sv_addresscontrolposition'];
        $getlocations_defaults['sv_pancontrol'] = $extras['sv_pancontrol'];
        $getlocations_defaults['sv_pancontrolposition'] = $extras['sv_pancontrolposition'];
        $getlocations_defaults['sv_zoomcontrol'] = $extras['sv_zoomcontrol'];
        $getlocations_defaults['sv_zoomcontrolposition'] = $extras['sv_zoomcontrolposition'];
        $getlocations_defaults['sv_linkscontrol'] = $extras['sv_linkscontrol'];
        $getlocations_defaults['sv_imagedatecontrol'] = $extras['sv_imagedatecontrol'];
        $getlocations_defaults['sv_scrollwheel'] = $extras['sv_scrollwheel'];
        $getlocations_defaults['sv_clicktogo'] = $extras['sv_clicktogo'];
      }
      if (getlocations_fields_map_settings_allow()) {
        $getlocations_defaults['nodezoom'] = $extras['mapzoom'];
        $getlocations_defaults['maptype'] = $extras['map_maptype'];

        // update baselayers
        $getlocations_defaults['baselayers'][$extras['map_maptype']] = 1;
      }
    }
  }
  $mapid = getlocations_setup_map($getlocations_defaults);
  getlocations_js_settings_do($getlocations_defaults, $latlons, $minmaxes, $mapid);
  if (empty($width)) {
    $width = $getlocations_defaults['width'];
  }
  if (empty($height)) {
    $height = $getlocations_defaults['height'];
  }
  return theme('getlocations_show', array(
    'width' => $width,
    'height' => $height,
    'defaults' => $getlocations_defaults,
    'mapid' => $mapid,
    'latlons' => $latlons,
    'minmaxes' => $minmaxes,
    'type' => $type,
    'node' => $node,
  ));
}