You are here

function gm3_settings in Google Maps API V3 7

Get the default settings. Note, these vary slightly from Google's default settings, as not all of Google's defaults are appropriate for the intended uses of the GM3 module. The following changes have been made:

center: Now centered on Europe. backgroundColor: white mapTypeId: google.maps.MapTypeId.TERRAIN panControl: false scaleControl: false streetViewControl: false

2 calls to gm3_settings()
gm3_add in ./gm3.theme.inc
Callback to add a Google map to a specific element ID on the page.
gm3_admin_settings_form in ./gm3.admin.inc
Admin settings

File

./gm3.module, line 364

Code

function gm3_settings() {
  return variable_get('gm3_default_settings', array(
    'width' => '100%',
    'height' => '500px',
    'center' => array(
      'latitude' => 52,
      'longitude' => 0,
    ),
    //'backgroundColor' => 'white',
    'disableDefaultUI' => FALSE,
    'disableDoubleClickZoom' => FALSE,
    'draggable' => TRUE,
    'draggableCursor' => 'move',
    'draggingCursor' => 'move',
    'heading' => 0,
    'keyboardShortcuts' => TRUE,
    'mapTypeControl' => TRUE,
    'mapTypeControlOptions' => array(
      'mapTypeIds' => array(
        'google.maps.MapTypeId.HYBRID',
        'google.maps.MapTypeId.ROADMAP',
        'google.maps.MapTypeId.SATELLITE',
        'google.maps.MapTypeId.TERRAIN',
      ),
      'style' => 'google.maps.MapTypeControlStyle.DEFAULT',
      // http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeControlStyle
      'position' => 'google.maps.ControlPosition.TOP_RIGHT',
    ),
    'mapTypeId' => 'google.maps.MapTypeId.TERRAIN',
    // SATELLITE, TERRAIN, ROADMAP, HYBRID
    'maxZoom' => null,
    'minZoom' => 2,
    'noClear' => FALSE,
    'overviewMapControl' => FALSE,
    'overviewMapControlOptions' => array(
      'opened' => TRUE,
    ),
    'panControl' => FALSE,
    'panControlOptions' => array(
      'position' => 'google.maps.ControlPosition.TOP_LEFT',
    ),
    'rotateControl' => TRUE,
    'rotateControlOptions' => array(
      'position' => 'google.maps.ControlPosition.TOP_LEFT',
    ),
    'scaleControl' => FALSE,
    'scaleControlOptions' => array(
      'position' => 'google.maps.ControlPosition.BOTTOM_LEFT',
      'style' => 'google.maps.ScaleControlStyle.DEFAULT',
    ),
    'scrollwheel' => TRUE,
    // 'streeView' => '', // This appears to be more complicated than we require
    // if users would like this, then they can add it!
    'streetViewControl' => FALSE,
    'streetViewControlOptions' => array(
      'position' => '',
    ),
    // 'styles' => '', // Deliberately left blank.  This may be tweaked in the
    // future.
    'tilt' => 0,
    'zoom' => 4,
    'zoomControl' => TRUE,
    'zoomControlOptions' => array(
      'position' => 'google.maps.ControlPosition.TOP_LEFT',
      'style' => 'google.maps.ZoomControlStyle.DEFAULT',
    ),
  ));
}