This commit is contained in:
bastianonm 2012-06-13 13:14:18 +00:00
parent 53e4f11368
commit 1f74662887
6 changed files with 31 additions and 9 deletions

View File

@ -365,9 +365,9 @@ function _wpgpxmaps(params)
map.setCenter(bounds.getCenter());
map.fitBounds(bounds);
if (graphDist != '')
if (graphDist != '' && (graphEle != '' || graphSpeed != '' || graphHr != '' || graphCad != ''))
{
var valLen = graphDist.length;
var l_x;

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.23
Stable tag: 1.1.24
License: GPLv2 or later
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map.

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.23
Version: 1.1.24
Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/
License: GPL
@ -127,6 +127,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$currentIcon = findValue($attr, "currenticon", "wpgpxmaps_map_current_icon", "");
$ngGalleries = findValue($attr, "nggalleries", "wpgpxmaps_map_ngGalleries", "");
$ngImages = findValue($attr, "ngimages", "wpgpxmaps_map_ngImages", "");
$download = findValue($attr, "download", "wpgpxmaps_download", "");
$r = rand(1,5000000);
@ -344,6 +345,11 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
});
});
</script>';
if ($download=='true' && $gpx != '')
{
$output.="<a href='$gpx' target='_new'>Download</a>";
}
return $output;
}
@ -405,6 +411,7 @@ function WP_GPX_Maps_install() {
add_option("wpgpxmaps_graph_line_color_hr", '#ff77bd', '', 'yes');
add_option('wpgpxmaps_show_cadence','','','yes');
add_option('wpgpxmaps_zoomonscrollwheel','','','yes');
add_option('wpgpxmaps_download','','','yes');
}
function WP_GPX_Maps_remove() {
@ -434,6 +441,7 @@ function WP_GPX_Maps_remove() {
delete_option('wpgpxmaps_show_cadence');
delete_option('wpgpxmaps_graph_line_color_cad');
delete_option('wpgpxmaps_zoomonscrollwheel');
delete_option('wpgpxmaps_download');
}
?>

View File

@ -115,7 +115,8 @@ 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>
<li><b>zoomonscrollwheel</b>: zoom on map when mouse scroll wheel (default is FALSE)</li>
<li><b>download</b>: Allow users to download your GPX file (default is FALSE)</li>
</ul>
<p>

View File

@ -1,3 +1,9 @@
<?php
if ( !is_admin() )
return;
?>
<script type="text/javascript" src="http://meta100.github.com/mColorPicker/javascripts/mColorPicker_min.js" charset="UTF-8"></script>
@ -13,6 +19,7 @@
$showHr = get_option('wpgpxmaps_show_hr');
$showCad = get_option('wpgpxmaps_show_cadence');
$zoomonscrollwheel = get_option("wpgpxmaps_zoomonscrollwheel");
$download = get_option("wpgpxmaps_download");
if (!($t))
$t = 'HYBRID';
@ -25,7 +32,7 @@
<?php wp_nonce_field('update-options') ?>
<h3 class="title">Map and Chart size</h3>
<h3 class="title">General</h3>
<table class="form-table">
<tr>
@ -46,11 +53,17 @@
<input name="wpgpxmaps_graph_height" type="text" id="wpgpxmaps_graph_height" value="<?php echo get_option('wpgpxmaps_graph_height'); ?>" style="width:50px;" />
</td>
</tr>
<tr>
<th scope="row">GPX Download:</th>
<td>
<input name="wpgpxmaps_download" type="checkbox" value="true" <?php if($download == true){echo('checked');} ?> onchange="this.value = (this.checked)" /><i>Allow users to download your GPX file</i>
</td>
</tr>
</table>
<p class="submit">
<input type="hidden" name="action" value="update" />
<input name="page_options" type="hidden" value="wpgpxmaps_height,wpgpxmaps_graph_height,wpgpxmaps_width" />
<input name="page_options" type="hidden" value="wpgpxmaps_height,wpgpxmaps_graph_height,wpgpxmaps_width,wpgpxmaps_download" />
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
@ -60,7 +73,7 @@
<?php wp_nonce_field('update-options') ?>
<h3 class="title">Maps</h3>
<h3 class="title">Map</h3>
<table class="form-table">
<tr>

View File

@ -136,7 +136,7 @@
$gpx->registerXPathNamespace('gpxx', 'http://www.garmin.com/xmlschemas/GpxExtensions/v3');
$gpx->registerXPathNamespace('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
$nodes = $gpx->xpath('//trkpt | //10:trkpt | //11:trkpt');
$nodes = $gpx->xpath('//trkpt | //10:trkpt | //11:trkpt | //11:rtept');
if ( count($nodes) > 0 )
{