* Added Bulgarian translation, thanks to Svilen Savov

* Added possibility to hide the elevation chart
This commit is contained in:
bastianonm 2013-11-18 13:45:18 +00:00
parent 0d6effb4f7
commit 223ad1c606
3 changed files with 33 additions and 9 deletions

View File

@ -4,8 +4,8 @@ Contributors: bastianonm
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8VHWLRW6JBTML
Tags: maps, gpx, gps, graph, chart, google maps, 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.6.1
Stable tag: 1.2.3
Tested up to: 3.7.1
Stable tag: 1.2.4
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map.
@ -26,7 +26,7 @@ Even if you don't have a gps camera, this plugin can retrive the image position
Old NGGallery Images (without gps data) and gpx: <a href="http://www.pedemontanadelgrappa.it/mappe/itinerario-3-alta-via-degli-eroi/">http://www.pedemontanadelgrappa.it/mappe/itinerario-3-alta-via-degli-eroi/</a>
Translated into 12 languages:
Translated into 13 languages:
- Dutch nl_NL
- English (default)
@ -40,6 +40,7 @@ Translated into 12 languages:
- Spanish es_ES
- Swedish sv_SE
- Turkish tr_TR
- Bulgarian bg_BG
(many thanks to all guys who helped me with the translations)
@ -103,6 +104,8 @@ The attributes are:
1. showhr: show heart rate inside the chart (default is FALSE)
1. showele: show elevation data inside the chart (default is TRUE)
1. showcad: show cadence inside the chart (default is FALSE)
1. showgrade: show grade inside the chart (default is FALSE)
@ -176,6 +179,9 @@ Yes!
1. Altitude & Speed & Hearth rate
== Changelog ==
= 1.2.4 =
* Added Bulgarian translation, thanks to Svilen Savov
* Added possibility to hide the elevation chart
= 1.2.2 =
* Smaller map type selector
* New map: MapToolKit - Terrain

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps
Plugin URI: http://www.devfarm.it/
Description: Draws a gpx track with altitude graph
Version: 1.2.3
Version: 1.2.4
Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/
*/
@ -113,8 +113,9 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$showCad = findValue($attr, "showcad", "wpgpxmaps_show_cadence", false);
$showHr = findValue($attr, "showhr", "wpgpxmaps_show_hr", false);
$showW = findValue($attr, "waypoints", "wpgpxmaps_show_waypoint", false);
$showEle = findValue($attr, "showele", "wpgpxmaps_show_elevation", "true");
$showSpeed = findValue($attr, "showspeed", "wpgpxmaps_show_speed", false);
$showGrade = findValue($attr, "showgrade", "wpgpxmaps_show_grade", false);
$showGrade = findValue($attr, "showgrade", "wpgpxmaps_show_grade", false);
$zoomOnScrollWheel = findValue($attr, "zoomonscrollwheel", "wpgpxmaps_zoomonscrollwheel", false);
$donotreducegpx = findValue($attr, "donotreducegpx", "wpgpxmaps_donotreducegpx", false);
$pointsoffset = findValue($attr, "pointsoffset", "wpgpxmaps_pointsoffset", 10);
@ -154,7 +155,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$gpxurl = $gpx;
$cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showW,$showHr,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,v1.1.38";
$cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showEle,$showW,$showHr,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,v1.1.38";
$cacheFileName = md5($cacheFileName);
@ -217,6 +218,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$isGpxUrl = (preg_match('/^(http(s)?\:\/\/)/', trim($gpx)) == 1);
if ((!isset($points_maps) || $points_maps == '') && $gpx != '') {
//if (true) {
$sitePath = sitePath();
@ -383,6 +385,11 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
}
}
if ($showEle == "false")
{
$points_graph_ele = "";
}
$p="/(,|,null,)$/";
$points_maps = preg_replace($p, "", $points_maps);
@ -413,7 +420,6 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
if (preg_match("/^(0,?)+$/", $points_graph_grade))
$points_graph_grade = "";
}

View File

@ -15,6 +15,7 @@
$t = get_option('wpgpxmaps_map_type');
$uom = get_option('wpgpxmaps_unit_of_measure');
$uomSpeed = get_option('wpgpxmaps_unit_of_measure_speed');
$showEle = get_option("wpgpxmaps_show_elevation");
$showSpeed = get_option('wpgpxmaps_show_speed');
$showHr = get_option('wpgpxmaps_show_hr');
$showCad = get_option('wpgpxmaps_show_cadence');
@ -32,6 +33,9 @@
$avg_speed = get_option("wpgpxmaps_summary_avg_speed");
$total_time = get_option("wpgpxmaps_summary_total_time");
if (empty($showEle))
$showEle = "true";
if (!($t))
$t = 'HYBRID';
if (!($po))
@ -270,10 +274,18 @@
<em>(leave empty for auto scale)</em>
</td>
</tr>
<tr>
<th scope="row">Show elevation:</th>
<td>
<input type="checkbox" <?php if($showEle == "true"){echo('checked');} ?> onchange="wpgpxmaps_show_elevation.value = this.checked" onload="wpgpxmaps_show_elevation.value = this.checked" /> <i>Show elevation</i>
<input name="wpgpxmaps_show_elevation" type="hidden" value="<?php echo $showEle; ?>">
</td>
</tr>
<tr>
<th scope="row">Show speed:</th>
<td>
<input name="wpgpxmaps_show_speed" type="checkbox" value="true" <?php if($showSpeed == true){echo('checked');} ?> onchange="this.value = (this.checked)" /><i>Show Speed</i>
<input name="wpgpxmaps_show_speed" type="checkbox" value="true" <?php if($showSpeed == true){echo('checked');} ?> onchange="this.value = (this.checked)" /> <i>Show Speed</i>
</td>
</tr>
<tr>
@ -350,7 +362,7 @@
<p class="submit">
<input type="hidden" name="action" value="update" />
<input name="page_options" type="hidden" value="wpgpxmaps_unit_of_measure,wpgpxmaps_graph_line_color,wpgpxmaps_show_speed,wpgpxmaps_graph_line_color_speed,wpgpxmaps_show_hr,wpgpxmaps_graph_line_color_hr,wpgpxmaps_unit_of_measure_speed,wpgpxmaps_graph_offset_from1,wpgpxmaps_graph_offset_to1,wpgpxmaps_graph_offset_from2,wpgpxmaps_graph_offset_to2,wpgpxmaps_graph_line_color_cad,wpgpxmaps_show_cadence,wpgpxmaps_show_grade,wpgpxmaps_graph_line_color_grade" />
<input name="page_options" type="hidden" value="wpgpxmaps_unit_of_measure,wpgpxmaps_graph_line_color,wpgpxmaps_show_elevation,wpgpxmaps_show_speed,wpgpxmaps_graph_line_color_speed,wpgpxmaps_show_hr,wpgpxmaps_graph_line_color_hr,wpgpxmaps_unit_of_measure_speed,wpgpxmaps_graph_offset_from1,wpgpxmaps_graph_offset_to1,wpgpxmaps_graph_offset_from2,wpgpxmaps_graph_offset_to2,wpgpxmaps_graph_line_color_cad,wpgpxmaps_show_cadence,wpgpxmaps_show_grade,wpgpxmaps_graph_line_color_grade" />
<input type="submit" class="button-primary" value="<?php _e('Save Changes', "wp_gpx_maps") ?>" />
</p>