? full_screen.css ? throbber.gif ? throbber.png ? js/full_screen.js ? js/markerloader_chunks.js ? markers/small/black.png ? markers/small/bpink.png ? markers/small/bred.png ? markers/small/brown.png ? markers/small/dblue.png ? markers/small/dgreen.png ? markers/small/fgreen.png ? markers/small/gray.png ? markers/small/green.png ? markers/small/lblue.png ? markers/small/lgray.png ? markers/small/orange.png ? markers/small/pblue.png ? markers/small/pgreen.png ? markers/small/pink.png ? markers/small/purple.png ? markers/small/pyellow.png ? markers/small/resources ? markers/small/white.png ? markers/small/yellow.png Index: gmap.css =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/Attic/gmap.css,v retrieving revision 1.3.2.2 diff -u -p -r1.3.2.2 gmap.css --- gmap.css 19 Sep 2007 00:23:21 -0000 1.3.2.2 +++ gmap.css 31 Mar 2008 07:58:23 -0000 @@ -28,3 +28,13 @@ v\:* { .gmap-right { float: right; } + +/* Hides lat-lon textfields when javascript is enabled in location pickers */ +html.js .gmap-location-picker .form-item { + display: none; +} + +/* Content area of info windows is about 60x120px by default */ +.gmap-loading-image { + margin: 15px 90px; +} Index: gmap.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/Attic/gmap.module,v retrieving revision 1.51.2.108 diff -u -p -r1.51.2.108 gmap.module --- gmap.module 18 Mar 2008 22:54:32 -0000 1.51.2.108 +++ gmap.module 31 Mar 2008 07:58:24 -0000 @@ -27,6 +27,11 @@ define('GMAP_WMS', variable_get('gmap_wm // for details on using other version numbers. define('GMAP_API_VERSION', '2.s'); +// Chunk markerloader defaults +define('GMAP_CHUNK_THRESHOLD', 20); +define('GMAP_CHUNK_SIZE', 1); +define('GMAP_CHUNK_DELAY', 200); + /** * Get the defaults for a gmap. @@ -35,10 +40,10 @@ function gmap_defaults() { $defaults = array( 'width' => '300px', 'height' => '200px', - 'zoom' => 3, + 'zoom' => 1, 'controltype' => 'Small', 'align' => 'None', - 'latlong' => '40,0', + 'latlong' => '30,-100', 'maptype' => 'Map', 'line_colors' => array('#00cc00', '#ff0000', '#0000ff'), ); @@ -70,28 +75,70 @@ function gmap_gmap($op, $map=null) { ); 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'])) { drupal_add_js($path .'icon.js'); drupal_add_js($path .'marker.js'); drupal_add_js($path . variable_get('gmap_mm_type', 'gmap') .'_marker.js'); } + if ($map['behavior']['locpick']) { drupal_add_js($path .'locpick.js'); + // Client-side UI strings need to be translatable too. + $js_settings['t']['locpickSingleClickMessage'] = t('Double click the map to set the location. Single click the marker to delete.'); } + + 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'); + + if ($map['lines'] || $map['markers']) { + // 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'); @@ -128,6 +175,11 @@ function gmap_gmap($op, $map=null) { '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, @@ -138,6 +190,11 @@ function gmap_gmap($op, $map=null) { 'default' => FALSE, 'help' => t('Removes the map type control from the upper right corner. Recommended for very narrow maps.'), ), + '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, @@ -164,7 +221,7 @@ function _gmap_doheader() { 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'); } @@ -174,9 +231,11 @@ function _gmap_doheader() { 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']); @@ -186,6 +245,15 @@ drupal_add_js($gmap_path .'/js/poly.js') } /** + * Returns html markup for the a loading image or 'throbber'. + */ +function theme_gmap_loading_image() { + $t = t('Loading...'); + $att = array('class' => 'gmap-loading-image'); + return theme('image', drupal_get_path('module', 'gmap') .'/throbber.gif', $t, $t, $att); +} + +/** * Cleans the gmap variables to prevent javascript interjection. * * @param $gmap @@ -997,7 +1065,6 @@ function theme_gmap_coord($element) { function theme_gmap_macrotext($element) { drupal_add_js(drupal_get_path('module', 'gmap') .'/js/macro.js'); - // @@@ drupal_add_js(drupal_get_path('module', 'gmap') .'/js/macrobuilder.js'); return theme('textarea', $element); } @@ -1046,7 +1113,10 @@ function theme_gmap($element) { $style[] = 'height: '. $map['height']; $element['#attributes']['class'] = trim($element['#attributes']['class'] .'gmap gmap-map gmap-'. $map['id'] .'-gmap'); - $o = '
'; + + // Some markup parsers (IE) don't handle empty inners well. Use the space to let users know javascript is required. + // @@@ Google static maps could be useful here. + $o = '
'. t('Javascript is required to view the map') .'
'; module_invoke_all('gmap', 'pre_theme_map', $map); Index: gmap_location.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/Attic/gmap_location.module,v retrieving revision 1.26.2.55 diff -u -p -r1.26.2.55 gmap_location.module --- gmap_location.module 6 Mar 2008 20:17:46 -0000 1.26.2.55 +++ gmap_location.module 31 Mar 2008 07:58:24 -0000 @@ -800,7 +800,7 @@ function gmap_location_user($op, &$edit, if (variable_get('gmap_user', 0) && user_access('set user location')) { switch ($op) { case 'load': - $result = db_query("SELECT latitude,longitude FROM {location} WHERE eid = %d AND type='user'", $user->uid); + $result = db_query("SELECT latitude,longitude FROM {location} WHERE eid = %d AND type='user' AND latitude IS NOT NULL", $user->uid); $u = db_fetch_object($result); if ($u) { $user->gmap_location_longitude = $u->longitude; @@ -821,20 +821,23 @@ function gmap_location_user($op, &$edit, case 'update': if ($category == 'gmap_user') { // source==1, location.module's LOCATION_LATLON_USER_SUBMITTED define. + $lid = db_next_id('{location}_lid'); + $lat = gmap_decimal($edit['gmap_location_latitude']); + $lon = gmap_decimal($edit['gmap_location_longitude']); + + // If the user is removing their location data, we need to do that in the DB too. + if ($lat == 0 && $lon == 0) { + $lat = $lon = 'NULL'; + } + // Insert or update based on the existance of $user->gmap_location_set. if ($user->gmap_location_set) { - db_query("UPDATE {location} SET latitude = %s , longitude = %s , source = 1 WHERE eid = %d AND type = 'user'", - gmap_decimal($edit['gmap_location_latitude']), - gmap_decimal($edit['gmap_location_longitude']), - $user->uid); + db_query("UPDATE {location} SET latitude = %s , longitude = %s , source = 1 WHERE eid = %d AND type = 'user'", $lat, $lon, $user->uid); } else { - $lid = db_next_id('{location}_lid'); - db_query("INSERT INTO {location} (eid, lid, type, latitude, longitude, source) VALUES (%d, %d, 'user', %s, %s, 1)", - $user->uid, $lid, - gmap_decimal($edit['gmap_location_latitude']), - gmap_decimal($edit['gmap_location_longitude'])); + db_query("INSERT INTO {location} (eid, lid, type, latitude, longitude, source) VALUES (%d, %d, 'user', %s, %s, 1)", $user->uid, $lid, $lat, $lon); } + unset($edit['gmap_location_latitude']); unset($edit['gmap_location_longitude']); } @@ -842,14 +845,17 @@ function gmap_location_user($op, &$edit, case 'form': if ($category == 'gmap_user' && user_access('set user location')) { + // Create a form for user location picker. $form = array(); $form['coordinates'] = array( '#type' => 'fieldset', '#title' => t('Coordinates'), + '#attributes' => array('class' => 'gmap-location-picker'), '#weight' => 5, '#collapsible' => $type!='user', '#collapsed' => false, + '#description' => t('Double click the map to set the location. Single click the marker to delete.'), ); // Reserve spot for map. @@ -869,15 +875,13 @@ function gmap_location_user($op, &$edit, '#default_value' => $edit['gmap_location_longitude'], '#size' => 30, '#maxlength' => 120, - '#description' => t('The latitude and longitude will be entered here when you click on a location in the interactive map above. You can also fill in the values manually.'), ); // @@@ Why is this based off the user map? $tmp = variable_get('gmap_user_map', _gmap_location_user_map_defaults()); - $form['coordinates']['gmap_node']['#value'] = gmap_set_location($tmp['macro'], $form['coordinates'], array('latitude' => 'gmap_location_latitude', 'longitude' => 'gmap_location_longitude')); -/* + /* if (variable_get('gmap_geocode', 1)) { $form['coordinates']['gmap_location_address'] = array( '#type' => 'textfield', @@ -885,7 +889,7 @@ function gmap_location_user($op, &$edit, '#description' => t('The address to be found on the map. Enter an address and then hit "TAB" and the current location will be updated. Please note that this address is not saved for the node, it is only used for finding a location.'), ); } -*/ + */ } return $form; } Index: gmap_settings_ui.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/Attic/gmap_settings_ui.inc,v retrieving revision 1.1.2.19 diff -u -p -r1.1.2.19 gmap_settings_ui.inc --- gmap_settings_ui.inc 21 Dec 2007 23:00:29 -0000 1.1.2.19 +++ gmap_settings_ui.inc 31 Mar 2008 07:58:24 -0000 @@ -19,7 +19,7 @@ function _gmap_admin_settings() { if (!module_exists('keys_api')) { $form['initialization']['googlemap_api_key'] = array( '#type' => 'textfield', - '#title' => t('Google map API key'), + '#title' => t('Google Maps API Key'), '#default_value' => variable_get('googlemap_api_key', ''), '#size' => 50, '#maxlength' => 255, @@ -29,11 +29,18 @@ function _gmap_admin_settings() { else { $form['initialization']['googlemap_api_key'] = array( '#type' => 'item', - '#title' => t('Google map API key'), + '#title' => t('Google Maps API Key'), '#description' => t('Your personal Googlemaps API key. You must get this for each separate website at Google Map API website.'), '#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_method'] = array( '#type' => 'select', '#disabled' => TRUE, @@ -188,37 +195,72 @@ function _gmap_admin_settings() { '#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'), @@ -229,7 +271,7 @@ function _gmap_admin_settings() { '#tree' => FALSE, '#required' => TRUE, '#options' => array( - 'gmap' => t('No manager (use addOverlay directly)'), + 'gmap' => t('No manager (use GMap API directly)'), 'gmarkermanager' => t("Google's GMarkerManager"), 'clusterer' => t("Jef Poskanzer's Clusterer"), ), @@ -346,7 +388,7 @@ function _gmap_admin_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=40,0|zoom=3|width=100%|height=400px]'), + '#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.'), Index: js/address.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/address.js,v retrieving revision 1.1.2.9 diff -u -p -r1.1.2.9 address.js --- js/address.js 30 Jul 2007 19:38:11 -0000 1.1.2.9 +++ js/address.js 31 Mar 2008 07:58:25 -0000 @@ -154,4 +154,3 @@ Drupal.gmap.addHandler('locpick_address' } }); }); - Index: js/align.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/align.js,v retrieving revision 1.1.2.6 diff -u -p -r1.1.2.6 align.js --- js/align.js 12 Mar 2007 23:12:57 -0000 1.1.2.6 +++ js/align.js 31 Mar 2008 07:58:25 -0000 @@ -40,5 +40,4 @@ Drupal.gmap.addHandler('gmap',function(e add.push('align='+obj.vars.align); } }); - -}); \ No newline at end of file +}); Index: js/gmap.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/gmap.js,v retrieving revision 1.1.2.25 diff -u -p -r1.1.2.25 gmap.js --- js/gmap.js 20 Mar 2008 22:50:53 -0000 1.1.2.25 +++ js/gmap.js 31 Mar 2008 07:58:25 -0000 @@ -379,10 +379,11 @@ Drupal.gmap.addHandler('controltype', fu }); }); +// Setup the maps. if (Drupal.jsEnabled) { $(document).ready(Drupal.gmap.setup) .unload(function() { - //Google cleanup. + // Google cleanup. GUnload(); }); } Index: js/gmap_shapes.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/gmap_shapes.js,v retrieving revision 1.1.2.4 diff -u -p -r1.1.2.4 gmap_shapes.js --- js/gmap_shapes.js 24 Aug 2007 06:44:57 -0000 1.1.2.4 +++ js/gmap_shapes.js 31 Mar 2008 07:58:25 -0000 @@ -83,4 +83,4 @@ Drupal.gmap.addHandler('gmap', function( }); } }); -}); \ No newline at end of file +}); Index: js/gmarkermanager_marker.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/gmarkermanager_marker.js,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 gmarkermanager_marker.js --- js/gmarkermanager_marker.js 18 Sep 2007 20:43:25 -0000 1.1.2.3 +++ js/gmarkermanager_marker.js 31 Mar 2008 07:58:25 -0000 @@ -38,4 +38,4 @@ Drupal.gmap.addHandler('gmap', function( obj.bind('clearmarkers',function() { // @@@ This is NOT AVAILABLE in this version. }); -}); \ No newline at end of file +}); Index: js/icon.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/icon.js,v retrieving revision 1.1.2.8 diff -u -p -r1.1.2.8 icon.js --- js/icon.js 4 Oct 2007 18:11:37 -0000 1.1.2.8 +++ js/icon.js 31 Mar 2008 07:58:25 -0000 @@ -196,5 +196,4 @@ Drupal.gmap.addHandler('gmap', function( marker.opts.icon = Drupal.gmap.getIcon(marker.markername,marker.offset); }); } - -}); \ No newline at end of file +}); Index: js/locpick.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/locpick.js,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 locpick.js --- js/locpick.js 12 Mar 2007 23:12:57 -0000 1.1.2.3 +++ js/locpick.js 31 Mar 2008 07:58:25 -0000 @@ -9,7 +9,7 @@ Drupal.gmap.addHandler('gmap',function(e var binding = obj.bind("locpickchange", function() { if (obj.locpick_coord) { - GEvent.trigger(obj.map,"click",null,obj.locpick_coord); + GEvent.trigger(obj.map,"dblclick", null, obj.locpick_coord); } }); @@ -22,8 +22,14 @@ Drupal.gmap.addHandler('gmap',function(e obj.bind("init", function() { if (obj.vars.behavior.locpick) { obj.locpick_coord = new GLatLng(obj.vars.latitude, obj.vars.longitude); - - GEvent.addListener(obj.map, "click", function(overlay,point) { + // Don't allow GMap2 to zoom on double click. That breaks the following listener. + obj.map.disableDoubleClickZoom(); + var singleClickCount = 0; + var doubleClicked = false; + + GEvent.addListener(obj.map, "dblclick", function(overlay,point) { + // Don't warn about single clicks, it's a double click. + doubleClicked = true; obj.map.checkResize(); if (!overlay) { if (obj.locpick_point) { @@ -36,9 +42,23 @@ Drupal.gmap.addHandler('gmap',function(e obj.map.panTo(point); obj.change('locpickchange', binding); } - else { + }); + + GEvent.addListener(obj.map, "click", function(overlay) { + if (overlay) { // Unsetting the location - obj.change('locpickremove',-1); + obj.change('locpickremove', -1); + } + else { + // This could be a double or a single click. Assume it's a single unless proven otherwise. + doubleClicked = false; + setTimeout(function() { + // It's a popup alertbox, which is rather annoying. So don't show it more than twice. + if (!doubleClicked && singleClickCount++ < 2) { + // It's definately a single click. Tell the user they need to double click. + alert(Drupal.settings.t.locpickSingleClickMessage); + } + }, 500); } }); } @@ -131,4 +151,3 @@ Drupal.gmap.addHandler('locpick_longitud } }); }); - Index: js/macro.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/macro.js,v retrieving revision 1.1.2.7 diff -u -p -r1.1.2.7 macro.js --- js/macro.js 21 Dec 2007 18:06:01 -0000 1.1.2.7 +++ js/macro.js 31 Mar 2008 07:58:25 -0000 @@ -48,4 +48,4 @@ Drupal.gmap.map.prototype.parse = functi if (m.substr(0,5)=='[gmap') { m = m.slice(6,-1); } -} \ No newline at end of file +}; Index: js/marker.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/marker.js,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 marker.js --- js/marker.js 18 Sep 2007 20:43:26 -0000 1.1.2.1 +++ js/marker.js 31 Mar 2008 07:58:25 -0000 @@ -33,14 +33,28 @@ Drupal.gmap.addHandler('gmap', function( // Default marker actions. obj.bind('clickmarker',function(marker) { - if (marker.text) { - marker.marker.openInfoWindowHtml(marker.text); - } + // AJAX content if (marker.rmt) { - $.get(obj.vars.rmtcallback + '/' + marker.rmt, {}, function(data){ + var uri = marker.rmt; + if (obj.vars.rmtcallback) { + uri = obj.vars.rmtcallback + '/' + marker.rmt; + } + $.get(uri, {}, function(data) { marker.marker.openInfoWindowHtml(data); }); + // Because we're waiting on an external http request, load something to let the user know we're working on it. + if (marker.text) { + marker.marker.openInfoWindowHtml(marker.text); + } + else if (Drupal.settings.loadingImage) { + marker.marker.openInfoWindowHtml(Drupal.settings.loadingImage); + } + } + // Local/stored content + else if (marker.text) { + marker.marker.openInfoWindowHtml(marker.text); } + // Tabbed content else if (marker.tabs) { var infoWinTabs = []; for (m in marker.tabs) { @@ -48,6 +62,7 @@ Drupal.gmap.addHandler('gmap', function( } marker.marker.openInfoWindowTabsHtml(infoWinTabs); } + // No content -- marker is a link else if (marker.link) { open(marker.link,'_self'); } Index: js/overlay_edit.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/overlay_edit.js,v retrieving revision 1.1.2.25 diff -u -p -r1.1.2.25 overlay_edit.js --- js/overlay_edit.js 24 Aug 2007 06:44:57 -0000 1.1.2.25 +++ js/overlay_edit.js 31 Mar 2008 07:58:25 -0000 @@ -278,4 +278,3 @@ Drupal.gmap.addHandler('overlayedit',fun } }); }); - Index: js/poly.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/poly.js,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 poly.js --- js/poly.js 6 May 2007 00:39:36 -0000 1.1.2.2 +++ js/poly.js 31 Mar 2008 07:58:25 -0000 @@ -1,7 +1,6 @@ /* $Id: poly.js,v 1.1.2.2 2007/05/06 00:39:36 bdragon Exp $ */ /** * GPolyLine / GPolygon manager - * */ Drupal.gmap.map.prototype.poly = {}; @@ -42,7 +41,7 @@ Drupal.gmap.map.prototype.poly.calcPolyP var angleRad = sAngle * d2r; // earth semi major axis is about 6378137 m var latScale = radM / 6378137 * r2d; - var lngScale = latScale / Math.cos(center.lngRadians()) + var lngScale = latScale / Math.cos(center.lngRadians()); var angInc = 2 * Math.PI / numPoints; var points = []; @@ -56,10 +55,4 @@ Drupal.gmap.map.prototype.poly.calcPolyP // close the shape and return it points.push(points[0]); return points; -} - -/** - * Circle -- on screen. - */ -//Drupal.gmap.map.prototype. - +}; Index: js/shapeloader_static.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/js/Attic/shapeloader_static.js,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 shapeloader_static.js --- js/shapeloader_static.js 24 Aug 2007 04:13:26 -0000 1.1.2.2 +++ js/shapeloader_static.js 31 Mar 2008 07:58:25 -0000 @@ -28,4 +28,4 @@ Drupal.gmap.addHandler('gmap', function( obj.change('shapesready',-1); }); } -}); \ No newline at end of file +}); Index: markers/small/blue.png =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/markers/small/Attic/blue.png,v retrieving revision 1.1 diff -u -p -r1.1 blue.png Binary files /tmp/cvsQ7Jw6Q and blue.png differ Index: markers/small/red.png =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/markers/small/Attic/red.png,v retrieving revision 1.1 diff -u -p -r1.1 red.png Binary files /tmp/cvsWG4vW1 and red.png differ Index: markers/small/small.ini =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gmap/markers/small/Attic/small.ini,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 small.ini --- markers/small/small.ini 6 Feb 2007 17:32:52 -0000 1.1.2.1 +++ markers/small/small.ini 31 Mar 2008 07:58:25 -0000 @@ -7,12 +7,88 @@ infoX = 10 infoY = 2 ; Marker sets +[small black] +name = "Small Black" +sequence = "black.png" + [small blue] name = "Small Blue" sequence = "blue.png" +[small bpink] +name = "Small Bright Pink" +sequence = "bpink.png" + +[small bred] +name = "Small Bright red" +sequence = "bred.png" + +[small brown] +name = "Small Brown" +sequence = "brown.png" + +[small dblue] +name = "Small Dark Blue" +sequence = "dblue.png" + +[small dgreen] +name = "Small Dark Green" +sequence = "dgreen.png" + +[small fgreen] +name = "Small Flouro Green" +sequence = "fgreen.png" + +[small gray] +name = "Small Gray" +sequence = "gray.png" + +[small green] +name = "Small Green" +sequence = "green.png" + +[small lblue] +name = "Small Light Blue" +sequence = "lblue.png" + +[small lgray] +name = "Small Light Gray" +sequence = "lgray.png" + +[small orange] +name = "Small Orange" +sequence = "orange.png" + +[small pblue] +name = "Small Pale Blue" +sequence = "pblue.png" + +[small pgreen] +name = "Small Pale Green" +sequence = "pgreen.png" + +[small pyellow] +name = "Small Pale Yellow" +sequence = "pyellow.png" + +[small pink] +name = "Small Pink" +sequence = "pink.png" + +[small purple] +name = "Small Purple" +sequence = "purple.png" + [small red] name = "Small Red" sequence = "red.png" -; Files \ No newline at end of file +[small white] +name = "Small White" +sequence = "white.png" + +[small yellow] +name = "Small Yellow" +sequence = "yellow.png" + +; Files