This commit is contained in:
bastianonm 2012-06-11 15:24:58 +00:00
parent 822bc69e0f
commit c199b58be5
5 changed files with 26 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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.'"
});
});
</script>';
@ -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');
}
?>

View File

@ -116,6 +116,7 @@ function WP_GPX_Maps_html_page() {
<li><b>currentIcon</b>: Current position icon (when mouse hover)</li>
<li><b>nggalleries</b>: NextGen Gallery id or a list of Galleries id separated by a comma</li>
<li><b>ngimages</b>: NextGen Image id or a list of Images id separated by a comma</li>
<li><b>zoomonscrollwheel</b>: zoom on map when mouse scroll wheel</li>
</ul>
<p>

View File

@ -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 @@
<h3 class="title">Maps</h3>
<table class="form-table">
<tr>
<th scope="row">On mouse scroll wheel:</th>
<td>
<input name="wpgpxmaps_zoomonscrollwheel" type="checkbox" value="true" <?php if($zoomonscrollwheel == true){echo('checked');} ?> onchange="this.value = (this.checked)" /><i>Enable zoom</i>
</td>
</tr>
<tr>
<th scope="row">Waypoints Support:</th>
<td>
@ -112,7 +119,7 @@
<p class="submit">
<input type="hidden" name="action" value="update" />
<input name="page_options" type="hidden" value="wpgpxmaps_show_waypoint,wpgpxmaps_map_line_color,wpgpxmaps_map_type,wpgpxmaps_map_start_icon,wpgpxmaps_map_end_icon,wpgpxmaps_map_current_icon" />
<input name="page_options" type="hidden" value="wpgpxmaps_show_waypoint,wpgpxmaps_map_line_color,wpgpxmaps_map_type,wpgpxmaps_map_start_icon,wpgpxmaps_map_end_icon,wpgpxmaps_map_current_icon,wpgpxmaps_zoomonscrollwheel" />
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>