From c199b58be56b05268128261901f14ee8cb9595c3 Mon Sep 17 00:00:00 2001 From: bastianonm Date: Mon, 11 Jun 2012 15:24:58 +0000 Subject: [PATCH] --- WP-GPX-Maps.js | 3 ++- readme.txt | 7 +++++-- wp-gpx-maps.php | 13 ++++++++++--- wp-gpx-maps_admin.php | 1 + wp-gpx-maps_admin_settings.php | 9 ++++++++- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/WP-GPX-Maps.js b/WP-GPX-Maps.js index 42b7c99..e29ad68 100644 --- a/WP-GPX-Maps.js +++ b/WP-GPX-Maps.js @@ -144,6 +144,7 @@ function _wpgpxmaps(params) var startIcon = params.startIcon; var endIcon = params.endIcon; var currentIcon = params.currentIcon; + var zoomOnScrollWheel = params.zoomOnScrollWheel; var el = document.getElementById("wpgpxmaps_" + targetId); var el_map = document.getElementById("map_" + targetId); @@ -172,7 +173,7 @@ function _wpgpxmaps(params) var map = new google.maps.Map(el_map, { mapTypeId: mapType, - scrollwheel: false, + scrollwheel: (zoomOnScrollWheel == 'true'), mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, mapTypeIds: mapTypeIds diff --git a/readme.txt b/readme.txt index 6e79341..3549fe9 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: maps, gpx, gps, graph, chart, google maps, highcharts, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence Requires at least: 2.0.0 Tested up to: 3.3 -Stable tag: 1.1.21 +Stable tag: 1.1.22 License: GPLv2 or later Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. @@ -105,7 +105,7 @@ The attributes are: 1. ngimages: NextGen Image id or a list of Images id separated by a comma - +1. zoomonscrollwheel: zoom on map when mouse scroll wheel = What happening if I've a very large gpx? = @@ -123,6 +123,9 @@ Yes! 1. Altitude & Speed & Hearth rate == Changelog == += 1.1.22 = +* enable map zoom on scroll wheel (check settings) +* test attributes in get params = 1.1.21 = * google maps images fixed (templates with bad css) * upgrade to google maps 3.9 diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php index 472c6c0..a675310 100644 --- a/wp-gpx-maps.php +++ b/wp-gpx-maps.php @@ -3,7 +3,7 @@ Plugin Name: WP-GPX-Maps Plugin URI: http://www.darwinner.it/ Description: Draws a gpx track with altitude graph -Version: 1.1.21 +Version: 1.1.22 Author: Bastianon Massimo Author URI: http://www.pedemontanadelgrappa.it/ License: GPL @@ -83,6 +83,10 @@ function findValue($attr, $attributeName, $optionName, $defaultValue) { $val = get_option($optionName); } + if ($val == '' && isset($_GET[$attributeName])) + { + $val = $_GET[$attributeName]; + } if ($val == '') { $val = $defaultValue; @@ -104,6 +108,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $showHr = findValue($attr, "showhr", "wpgpxmaps_show_hr", false); $showW = findValue($attr, "waypoints", "wpgpxmaps_show_waypoint", false); $showSpeed = findValue($attr, "showspeed", "wpgpxmaps_show_speed", false); + $zoomOnScrollWheel = findValue($attr, "zoomonscrollwheel", "wpgpxmaps_zoomonscrollwheel", false); $donotreducegpx = findValue($attr, "donotreducegpx", "wpgpxmaps_donotreducegpx", false); $pointsoffset = findValue($attr, "pointsoffset", "wpgpxmaps_pointsoffset", 10); $uom = findValue($attr, "uom", "wpgpxmaps_unit_of_measure", "0"); @@ -334,7 +339,8 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') chartTo2 : "'.$chartTo2.'", startIcon : "'.$startIcon.'", endIcon : "'.$endIcon.'", - currentIcon : "'.$currentIcon.'" + currentIcon : "'.$currentIcon.'", + zoomOnScrollWheel : "'.$zoomOnScrollWheel.'" }); }); '; @@ -398,7 +404,7 @@ function WP_GPX_Maps_install() { add_option("wpgpxmaps_show_hr", '', '', 'yes'); add_option("wpgpxmaps_graph_line_color_hr", '#ff77bd', '', 'yes'); add_option('wpgpxmaps_show_cadence','','','yes'); - + add_option('wpgpxmaps_zoomonscrollwheel','','','yes'); } function WP_GPX_Maps_remove() { @@ -427,6 +433,7 @@ function WP_GPX_Maps_remove() { delete_option('wpgpxmaps_graph_line_color_hr'); delete_option('wpgpxmaps_show_cadence'); delete_option('wpgpxmaps_graph_line_color_cad'); + delete_option('wpgpxmaps_zoomonscrollwheel'); } ?> diff --git a/wp-gpx-maps_admin.php b/wp-gpx-maps_admin.php index 2be7249..32344e7 100644 --- a/wp-gpx-maps_admin.php +++ b/wp-gpx-maps_admin.php @@ -116,6 +116,7 @@ function WP_GPX_Maps_html_page() {
  • currentIcon: Current position icon (when mouse hover)
  • nggalleries: NextGen Gallery id or a list of Galleries id separated by a comma
  • ngimages: NextGen Image id or a list of Images id separated by a comma
  • +
  • zoomonscrollwheel: zoom on map when mouse scroll wheel
  • diff --git a/wp-gpx-maps_admin_settings.php b/wp-gpx-maps_admin_settings.php index 4c07728..28e2a60 100644 --- a/wp-gpx-maps_admin_settings.php +++ b/wp-gpx-maps_admin_settings.php @@ -12,6 +12,7 @@ $showSpeed = get_option('wpgpxmaps_show_speed'); $showHr = get_option('wpgpxmaps_show_hr'); $showCad = get_option('wpgpxmaps_show_cadence'); + $zoomonscrollwheel = get_option("wpgpxmaps_zoomonscrollwheel"); if (!($t)) $t = 'HYBRID'; @@ -62,6 +63,12 @@

    Maps

    + + + +
    On mouse scroll wheel: + onchange="this.value = (this.checked)" />Enable zoom +
    Waypoints Support: @@ -112,7 +119,7 @@

    - +