Index: gmap_macro_builder.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap_macro_builder.info,v
retrieving revision 1.3
diff -u -r1.3 gmap_macro_builder.info
--- gmap_macro_builder.info 15 Jul 2008 18:09:12 -0000 1.3
+++ gmap_macro_builder.info 28 Aug 2008 10:04:21 -0000
@@ -4,3 +4,10 @@
package = Location
core = 6.x
dependencies[] = gmap
+
+; Information added by drupal.org packaging script on 2008-08-22
+version = "6.x-1.x-dev"
+core = "6.x"
+project = "gmap"
+datestamp = "1219363471"
+
Index: gmap_location.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap_location.module,v
retrieving revision 1.32
diff -u -r1.32 gmap_location.module
--- gmap_location.module 15 Jul 2008 22:30:05 -0000 1.32
+++ gmap_location.module 28 Aug 2008 10:04:21 -0000
@@ -512,7 +512,7 @@
$form['node']['gmap_node_markers'] = array(
'#type' => 'fieldset',
'#title' => t('Markers per content type'),
- '#description' => t('Choose a marker to represent each type of content on the node map.'),
+ '#description' => t('Choose a marker to represent each type of content on the node map. Node types that are not location-enabled are not shown here.') .' '. l(t('Location-enable node types.'), 'admin/content/types'),
'#tree' => TRUE,
);
@@ -521,13 +521,12 @@
$defaults = variable_get('gmap_node_markers', array());
foreach ($ntypes as $key => $value) {
- $form['node']['gmap_node_markers'][$key] = array(
- '#type' => 'gmap_markerchooser',
- '#title' => t('Marker for '. $value->name),
- '#default_value' => isset($defaults[$key]) ? $defaults[$key] : 'drupal',
- );
- if (intval(variable_get('location_maxnum_'. $key, 0)) === 0) {
- $form['node']['gmap_node_markers'][$key]['#description'] = t('This content type is not currently Location enabled.');
+ if (variable_get('location_maxnum_'. $key, 0)) {
+ $form['node']['gmap_node_markers'][$key] = array(
+ '#type' => 'gmap_markerchooser',
+ '#title' => t('%type marker', array('%type' => $value->name)),
+ '#default_value' => isset($defaults[$key]) ? $defaults[$key] : 'drupal',
+ );
}
}
return system_settings_form($form);
Index: gmap_settings_ui.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap_settings_ui.inc,v
retrieving revision 1.5
diff -u -r1.5 gmap_settings_ui.inc
--- gmap_settings_ui.inc 15 Jul 2008 21:23:17 -0000 1.5
+++ gmap_settings_ui.inc 28 Aug 2008 10:04:21 -0000
@@ -35,18 +35,29 @@
'#value' => t("Managed by keys api.", array('@url' => url('admin/settings/keys'))),
);
}
+ $form['initialization']['gmap_api_version'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Google Maps API Version'),
+ '#default_value' => variable_get('gmap_api_version', GMAP_API_VERSION),
+ '#description' => t("The version string that identifies which version of the Google Maps API to use. 's' is for stable. 'x' is for latest. See Google Maps API Version Changes page for details and the Mapki.com changlog for a more granular changelog."),
+ '#size' => 4,
+ );
+
$form['initialization']['gmap_load_zoom_plugin'] = array(
'#type' => 'checkbox',
'#title' => t('Enable mousewheel zooming'),
'#default_value' => variable_get('gmap_load_zoom_plugin', TRUE),
+ // @@@ @todo why would one use mousewheel.js instead of GMap2 API's mousewheel sooming feature?
'#description' => t('Enables the mousewheel.js jQuery plugin, which adds the ability to use the mouse wheel to zoom the map.'),
);
- if (!file_exists(drupal_get_path('module', 'gmap') .'/thirdparty/mousewheel.js')) {
+ $mousewheel_path = drupal_get_path('module', 'gmap') .'/thirdparty/mousewheel.js';
+ if (!file_exists($mousewheel_path)) {
variable_set('gmap_load_zoom_plugin', FALSE);
$form['initialization']['gmap_load_zoom_plugin']['#default_value'] = FALSE;
$form['initialization']['gmap_load_zoom_plugin']['#value'] = FALSE;
$form['initialization']['gmap_load_zoom_plugin']['#disabled'] = TRUE;
- $form['initialization']['gmap_load_zoom_plugin']['#description'] += '
'. t('The mousewheel.js file was not found. Please download and place in the thirdparty/ folder.');
+ $form['initialization']['gmap_load_zoom_plugin']['#description'] .= t('mousewheel.js file was not found. Please download and place in %path.', array('%path' => $mousewheel_path));
+
}
$defaults = gmap_defaults();
@@ -181,7 +192,7 @@
'#tree' => FALSE,
'#parents' => array('gmap_default', 'maptype'),
'#title' => t('Default map type'),
- '#default_value' => $defaults['maptype'],
+ '#default_value' => $defaults['baselayers']['maptype'],
'#options' => $options,
);
gmap_widget_setup($form['gmap_default']['baselayers']['maptype'], 'maptype', 'settings_default_map');
@@ -258,37 +269,72 @@
'#maxlength' => 7,
);
+ // Settings for chunks markerloader.
+ $chunk_settings = variable_get('gmap_chunk_markerloader', array(
+ 'autoLoad' => TRUE, // Automatically use the chunk marker loader if there are lots of markers?
+ 'threshold' => GMAP_CHUNK_THRESHOLD, // How many is 'lots'?
+ 'chunkSize' => GMAP_CHUNK_SIZE, // How many markers per chunk.
+ 'chunkDelay' => GMAP_CHUNK_DELAY, // Delay between each chunk in miliseconds.
+ ));
+ $form['gmap_chunk_markerloader'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Chunk Markerloader Settings'),
+ '#description' => t('The Chunk Markerloader is for managing large quantities of markers on a map. Processing lots of markers can cause the browser to freeze and appear to have crashed while it processes the markers and adds them to the DOM. Chunk Markerloader is an alternative to marker managers and clusterers, and probably will not work together with marker managers and clusterers. The Chunk Markerloader is used if the Chunk Autoload Threshold is reached and Chunk Autoload is on. It can also be activated by setting it as a GMap module behavior.'),
+ '#tree' => TRUE,
+ 'autoLoad' => array(
+ '#type' => 'checkbox',
+ '#title' => t('Chunk Autoload'),
+ '#description' => t('Autoload Chunk Markerloader if the threshold is reached'),
+ '#default_value' => $chunk_settings['autoLoad'],
+ '#size' => 4,
+ ),
+ 'threshold' => array(
+ '#type' => 'textfield',
+ '#title' => t('Chunk Autoload Theshold'),
+ '#description' => t('The minimum quantity of markers required for the Chunk Markerloader to be auto-loaded (Chunk Autoload must also be on).'),
+ '#default_value' => $chunk_settings['threshold'],
+ '#size' => 4,
+ ),
+ 'chunkSize' => array(
+ '#type' => 'textfield',
+ '#title' => t('Chunk Size'),
+ '#description' => t('The number of markers loaded in each chunk.'),
+ '#default_value' => $chunk_settings['chunkSize'],
+ '#size' => 4,
+ ),
+ 'chunkDelay' => array(
+ '#type' => 'textfield',
+ '#title' => t('Chunk Delay (ms)'),
+ '#description' => t('The length of the pause (timeout()) in miliseconds between each chunk.'),
+ '#default_value' => $chunk_settings['chunkDelay'],
+ '#size' => 4,
+ ),
+ );
+
+ // Ensure the $opts data structure is valid.
$opts = variable_get('gmap_markermanager', array());
- if (!is_array($opts['gmap'])) {
- $opts['gmap'] = array();
- }
- if (!is_array($opts['gmarkermanager'])) {
- $opts['gmarkermanager'] = array();
- }
- if (!is_array($opts['clusterer'])) {
- $opts['clusterer'] = array();
+ $default_opts = array(
+ 'gmap' => array(),
+ 'gmarkermanager' => array(
+ 'borderPadding' => 0,
+ 'maxZoom' => 4,
+ 'trackMarkers' => FALSE,
+ 'markerMinZoom' => 4,
+ 'markerMaxZoom' => 0,
+ ),
+ 'clusterer' => array(
+ 'clusterer_file' => 'Clusterer2.js',
+ 'marker' => 'cluster',
+ 'max_nocluster' => 150,
+ 'cluster_min' => 5,
+ 'max_lines' => 10,
+ ),
+ );
+ $opts = array_merge($default_opts, $opts);
+ foreach($default_opts as $key => $array) {
+ $opts[$key] = array_merge($array, $opts[$key]);
}
- $opts['gmap'] = array_merge(array(
- // None.
- ), $opts['gmap']);
-
- $opts['gmarkermanager'] = array_merge(array(
- 'borderPadding' => 0,
- 'maxZoom' => 4,
- 'trackMarkers' => FALSE,
- 'markerMinZoom' => 4,
- 'markerMaxZoom' => 0,
- ), $opts['gmarkermanager']);
-
- $opts['clusterer'] = array_merge(array(
- 'clusterer_file' => 'Clusterer2.js',
- 'marker' => 'cluster',
- 'max_nocluster' => 150,
- 'cluster_min' => 5,
- 'max_lines' => 10,
- ), $opts['clusterer']);
-
$form['gmap_markermanager'] = array(
'#type' => 'fieldset',
'#title' => t('Marker manager'),
@@ -409,6 +455,19 @@
'#default_value' => $opts['clusterer']['max_lines'],
);
+ $form['location'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Location settings'),
+ );
+ $form['location']['gmap_location_map'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Default location map'),
+ '#default_value' => variable_get('gmap_location_map', '[gmap|id=locmap|center=30,-100|zoom=1|width=100%|height=400px]'),
+ '#size' => 50,
+ '#maxlength' => 500,
+ '#description' => t('The gmap macro for the map to be used in the location.module for setting latitude and longitude.'),
+ );
+
// @@@ Convert to element level validation.
$form['#validate'][] = 'gmap_admin_settings_validate';
Index: gmap_taxonomy.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap_taxonomy.info,v
retrieving revision 1.3
diff -u -r1.3 gmap_taxonomy.info
--- gmap_taxonomy.info 15 Jul 2008 18:09:12 -0000 1.3
+++ gmap_taxonomy.info 28 Aug 2008 10:04:21 -0000
@@ -5,3 +5,10 @@
core = 6.x
dependencies[] = taxonomy
dependencies[] = gmap
+
+; Information added by drupal.org packaging script on 2008-08-22
+version = "6.x-1.x-dev"
+core = "6.x"
+project = "gmap"
+datestamp = "1219363471"
+
Index: gmap_views.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap_views.info,v
retrieving revision 1.2
diff -u -r1.2 gmap_views.info
--- gmap_views.info 15 Jul 2008 16:30:29 -0000 1.2
+++ gmap_views.info 28 Aug 2008 10:04:21 -0000
@@ -2,4 +2,10 @@
name = GMap Views Integration
description = Allows the use of GMap in Views.
package = Location
-dependencies = gmap views location_views
\ No newline at end of file
+dependencies = gmap views location_views
+; Information added by drupal.org packaging script on 2008-08-22
+version = "6.x-1.x-dev"
+core = "6.x"
+project = "gmap"
+datestamp = "1219363471"
+
Index: gmap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap.module,v
retrieving revision 1.64
diff -u -r1.64 gmap.module
--- gmap.module 21 Aug 2008 18:18:08 -0000 1.64
+++ gmap.module 28 Aug 2008 10:04:21 -0000
@@ -25,6 +25,11 @@
// for details on using other version numbers.
define('GMAP_API_VERSION', '2.115');
+// Chunk markerloader defaults
+define('GMAP_CHUNK_THRESHOLD', 20);
+define('GMAP_CHUNK_SIZE', 1);
+define('GMAP_CHUNK_DELAY', 200);
+
/**
* Get the defaults for a gmap.
*/
@@ -32,14 +37,13 @@
$defaults = array(
'width' => '300px',
'height' => '200px',
- 'zoom' => 3,
+ 'zoom' => 1,
'maxzoom' => 14,
'controltype' => 'Small',
'align' => 'None',
- 'latlong' => '40,0',
- 'maptype' => 'Map',
+ 'latlong' => '30, -100',
'mtc' => 'standard',
- 'baselayers' => array('Map', 'Satellite', 'Hybrid'),
+ 'baselayers' => array('maptype' => 'Map', 'Map', 'Satellite', 'Hybrid'),
'styles' => array(
'line_default' => array('0000ff', 5, 45, '', 0, 0),
'poly_default' => array('000000', 3, 25, 'ff0000', 45),
@@ -52,8 +56,8 @@
foreach ($behaviors as $k => $v) {
$defaults['behavior'][$k] = $v['default'];
}
- $defaults = array_merge($defaults, variable_get('gmap_default', array()));
- return $defaults;
+ $stored = variable_get('gmap_default', array());
+ return array_merge($defaults, $stored);
}
/**
@@ -72,6 +76,10 @@
'gmap_align' => array('arguments' => array('element')),
'gmap_style' => array('arguments' => array('element')),
'gmap' => array('arguments' => array('element')),
+ 'gmap_script' => array('arguments' => array('element')),
+ 'gmap_loading_image' => array('arguments' => array('element')),
+ 'gmap_map_script' => array('arguments' => array('element')),
+ 'gmap_map_no_js_placeholder' => array('arguments' => array('element')),
);
}
@@ -94,6 +102,8 @@
);
case 'pre_theme_map':
$path = drupal_get_path('module', 'gmap') .'/js/';
+ $js_settings = array();
+
// Activate markers if needed
if ($map['behavior']['dynmarkers'] || !empty($map['markers'])) {
// The marker data is not a real file. Work around this fact.
@@ -106,22 +116,62 @@
drupal_add_js($path .'marker.js');
drupal_add_js($path . variable_get('gmap_mm_type', 'gmap') .'_marker.js');
}
+
if (isset($map['behavior']['locpick']) && $map['behavior']['locpick']) {
drupal_add_js($path .'locpick.js');
}
+
+ if ($map['behavior']['fullscreenswitcher']) {
+ // Text for the fullscreen button / control
+ $js_settings['t']['fullScreenSwitcher'] = array(
+ 'textOff' => t('Full Screen'),
+ 'titleOff' => t('Show map in full screen'),
+ 'textOn' => t('Exit'),
+ 'titleOn' => t('Exit full screen'),
+ );
+ drupal_add_js($path .'full_screen.js');
+ drupal_add_css(drupal_get_path('module', 'gmap') . '/full_screen.css');
+ }
+
if (variable_get('gmap_load_zoom_plugin', TRUE) && !$map['behavior']['nomousezoom']) {
drupal_add_js(drupal_get_path('module', 'gmap') .'/thirdparty/mousewheel.js');
}
+
if ($map['markers'] || $map['lines']) {
- drupal_add_js($path .'markerloader_static.js');
+// drupal_add_js($path .'markerloader_static.js');
+ // Get the chunk markerloader settings.
+ $chunk_settings = variable_get('gmap_chunk_markerloader', array(
+ 'autoLoad' => TRUE, // Automatically use the chunk marker loader if there are lots of markers?
+ 'threshold' => GMAP_CHUNK_THRESHOLD, // How many is 'lots'?
+ 'chunkSize' => GMAP_CHUNK_SIZE, // How many markers per chunk.
+ 'chunkDelay' => GMAP_CHUNK_DELAY, // Delay between each chunk in miliseconds.
+ ));
+
+ // Should we load markers in chunks?
+ if ($map['behavior']['chunkmarkerloader'] || ($chunk_settings['autoLoad'] && (count($map['markers']) > $chunk_settings['threshold']))) {
+ // loadChunkMarkers() in js/markerloader_chunks.js needs these settings too.
+ $js_settings['loadChunkMarkers'] = $chunk_settings;
+ drupal_add_js($path .'markerloader_chunks.js');
+ }
+ else {
+ drupal_add_js($path .'markerloader_static.js');
+ }
}
+
if ($map['shapes']) {
drupal_add_js($path .'shapeloader_static.js');
drupal_add_js($path .'gmap_shapes.js');
}
+
if (is_array($map['feed'])) {
drupal_add_js($path .'markerloader_georss.js');
}
+
+ // Add the settings.
+ if (!empty($js_settings)) {
+ drupal_add_js($js_settings, 'setting');
+ }
+
break;
case 'macro_multiple':
return array('points', 'markers', 'feed', 'circle', 'rpolygon', 'polygon', 'line');
@@ -158,18 +208,28 @@
'default' => FALSE,
'help' => t('Load the marker loader system even if no markers to load are detected. Useful if you are injecting markers from somewhere else.'),
),
+ 'chunkmarkerloader' => array(
+ 'title' => t('Unconditionally load markers in chunks'),
+ 'default' => FALSE,
+ 'help' => t('Load markers in chunks, even if there are few markers. It is a good idea to load markers in chunks if you have lots of markers. See the Chunk Markerloader settings for details and autoload settings.'),
+ ),
'overview' => array(
'title' => t('Enable Overview Map'),
'default' => FALSE,
'help' => t('Enable the "overview map" in the bottom right corner.'),
'previewable' => TRUE,
),
-/* 'notype' => array(
+ 'notype' => array(
'title' => t('Disable map type control'),
'default' => FALSE,
'help' => t('Removes the map type control from the upper right corner. Recommended for very narrow maps.'),
'previewable' => TRUE,
- ), */
+ ),
+ 'fullscreenswitcher' => array(
+ 'title' => t('Enable the Fullscreen Switcher'),
+ 'default' => FALSE,
+ 'help' => t('Adds a button control to the map that switches the map between fullscreen and standard modes.'),
+ ),
'collapsehack' => array(
'title' => t('Work around bugs when maps appear in collapsible fieldsets'),
'default' => FALSE,
@@ -223,7 +283,7 @@
drupal_add_css($gmap_path .'/gmap.css');
drupal_add_js($gmap_path .'/js/gmap.js');
$mm = variable_get('gmap_mm_type', 'gmap');
- if ($mm=='clusterer') {
+ if ($mm == 'clusterer') {
drupal_add_js($gmap_path .'/js/icon.js');
drupal_add_js($gmap_path .'/thirdparty/Clusterer2.js');
}
@@ -233,14 +293,20 @@
if (empty($mms[$mm])) {
$mms[$mm] = array();
}
+ // Html markup for the spinning 'loading' image for asynchronous callbacks
+ drupal_add_js(array('loadingImage' => theme('gmap_loading_image')), 'setting');
drupal_add_js(array('gmap_markermanager' => $mms[$mm]), 'setting');
-// @@@
-drupal_add_js($gmap_path .'/js/poly.js');
+ // @@@
+ drupal_add_js($gmap_path .'/js/poly.js');
+
$key = variable_get('googlemap_api_key', '');
if (module_exists('keys_api')) {
$key = keys_api_get_key('gmap', $_SERVER['HTTP_HOST']);
}
- drupal_set_html_head('');
+ // drupal_set_html_head('');
+
+ // Allow themes and custom modules to put the scripts somewhere other than