diff --git a/WP-GPX-Maps.js b/WP-GPX-Maps.js
index b975632..ffc4440 100644
--- a/WP-GPX-Maps.js
+++ b/WP-GPX-Maps.js
@@ -459,6 +459,9 @@ function _wpgpxmaps(params)
l_y = { suf : "m", dec : 0 };
}
+ var nn = 1111.1;
+ var decPoint = nn.toLocaleString().substring(5, 6);
+ var thousandsSep = nn.toLocaleString().substring(1, 2);
// define the options
var hoptions = {
@@ -490,7 +493,6 @@ function _wpgpxmaps(params)
shared: true,
crosshairs: true,
formatter: function() {
-
if (marker)
{
var hchart_xserie = hchart.xAxis[0].series[0].data;
@@ -505,11 +507,10 @@ function _wpgpxmaps(params)
}
}
}
-
- var tooltip = "" + Highcharts.numberFormat(this.x, l_x.dec) + l_x.suf + "
";
+ var tooltip = "" + Highcharts.numberFormat(this.x, l_x.dec,decPoint,thousandsSep) + l_x.suf + "
";
for (i=0; i < this.points.length; i++)
{
- tooltip += this.points[i].series.name + ": " + Highcharts.numberFormat(this.points[i].y, l_y_arr[i].dec) + l_y_arr[i].suf + "
";
+ tooltip += this.points[i].series.name + ": " + Highcharts.numberFormat(this.points[i].y, l_y_arr[i].dec,decPoint,thousandsSep) + l_y_arr[i].suf + "
";
}
return tooltip;
}
@@ -533,7 +534,7 @@ function _wpgpxmaps(params)
xAxis: {
labels: {
formatter: function() {
- return Highcharts.numberFormat(this.value, l_x.dec) + l_x.suf;
+ return Highcharts.numberFormat(this.value, l_x.dec,decPoint,thousandsSep) + l_x.suf;
}
}
},
@@ -559,7 +560,7 @@ function _wpgpxmaps(params)
labels: {
align: 'left',
formatter: function() {
- return Highcharts.numberFormat(this.value, l_y.dec) + l_y.suf;
+ return Highcharts.numberFormat(this.value, l_y.dec,decPoint,thousandsSep) + l_y.suf;
}
}
}
@@ -594,7 +595,15 @@ function _wpgpxmaps(params)
var l_s;
- if (unitspeed == '2') // miles/h
+ if (unitspeed == '4') // min/miles
+ {
+ l_s = { suf : "min/mi", dec : 3 };
+ }
+ else if (unitspeed == '3') // min/km
+ {
+ l_s = { suf : "min/km", dec : 3 };
+ }
+ else if (unitspeed == '2') // miles/h
{
l_s = { suf : "mi/h", dec : 0 };
}
@@ -619,7 +628,7 @@ function _wpgpxmaps(params)
labels: {
//align: 'right',
formatter: function() {
- return Highcharts.numberFormat(this.value, l_s.dec) + l_s.suf;
+ return Highcharts.numberFormat(this.value, l_s.dec,decPoint,thousandsSep) + l_s.suf;
}
},
opposite: true
@@ -670,7 +679,7 @@ function _wpgpxmaps(params)
labels: {
//align: 'right',
formatter: function() {
- return Highcharts.numberFormat(this.value, l_hr.dec) + l_hr.suf;
+ return Highcharts.numberFormat(this.value, l_hr.dec,decPoint,thousandsSep) + l_hr.suf;
}
},
opposite: true
@@ -709,7 +718,7 @@ function _wpgpxmaps(params)
labels: {
//align: 'right',
formatter: function() {
- return Highcharts.numberFormat(this.value, l_cad.dec) + l_cad.suf;
+ return Highcharts.numberFormat(this.value, l_cad.dec,decPoint,thousandsSep) + l_cad.suf;
}
},
opposite: true
diff --git a/languages/wp-gpx-maps-it_IT.mo b/languages/wp-gpx-maps-it_IT.mo
index b000d39..535be90 100644
Binary files a/languages/wp-gpx-maps-it_IT.mo and b/languages/wp-gpx-maps-it_IT.mo differ
diff --git a/languages/wp-gpx-maps-it_IT.po b/languages/wp-gpx-maps-it_IT.po
index 23775bf..9798ca5 100644
--- a/languages/wp-gpx-maps-it_IT.po
+++ b/languages/wp-gpx-maps-it_IT.po
@@ -1,56 +1,80 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: wp-gpx-maps\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-06-21 14:24+0100\n"
-"PO-Revision-Date: 2012-06-21 14:31+0100\n"
-"Last-Translator: \n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-KeywordsList: __;_e\n"
-"X-Poedit-Basepath: .\n"
-"X-Poedit-Language: Italian\n"
-"X-Poedit-Country: ITALY\n"
-"X-Poedit-SearchPath-0: ..\n"
-
-#: ../wp-gpx-maps.php:348
-msgid "Altitude"
-msgstr "Altitudine"
-
-#: ../wp-gpx-maps.php:349
-msgid "Current Position"
-msgstr "Posizione Corrente"
-
-#: ../wp-gpx-maps.php:350
-msgid "Speed"
-msgstr "Velocità"
-
-#: ../wp-gpx-maps.php:351
-msgid "Heart rate"
-msgstr "Battito Cardiaco"
-
-#: ../wp-gpx-maps.php:352
-msgid "Cadence"
-msgstr "Cadenza"
-
-#: ../wp-gpx-maps.php:353
-msgid "Go Full Screen"
-msgstr "Schermo intero"
-
-#: ../wp-gpx-maps.php:354
-msgid "Exit Full Screen"
-msgstr "Torna a dimensioni originali"
-
-#: ../wp-gpx-maps.php:370
-msgid "Download"
-msgstr "Scarica"
-
-#: ../wp-gpx-maps_admin_settings.php:67
-#: ../wp-gpx-maps_admin_settings.php:143
-#: ../wp-gpx-maps_admin_settings.php:245
-#: ../wp-gpx-maps_admin_settings.php:276
-msgid "Save Changes"
-msgstr "Salva"
-
+msgid ""
+msgstr ""
+"Project-Id-Version: wp-gpx-maps\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-06-25 11:55+0100\n"
+"PO-Revision-Date: 2012-06-25 11:56+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: __;_e\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-Language: Italian\n"
+"X-Poedit-Country: ITALY\n"
+"X-Poedit-SearchPath-0: ..\n"
+
+#: ../wp-gpx-maps.php:420
+msgid "Altitude"
+msgstr "Altitudine"
+
+#: ../wp-gpx-maps.php:421
+msgid "Current Position"
+msgstr "Posizione Corrente"
+
+#: ../wp-gpx-maps.php:422
+msgid "Speed"
+msgstr "Velocità"
+
+#: ../wp-gpx-maps.php:423
+msgid "Heart rate"
+msgstr "Battito Cardiaco"
+
+#: ../wp-gpx-maps.php:424
+msgid "Cadence"
+msgstr "Cadenza"
+
+#: ../wp-gpx-maps.php:425
+msgid "Go Full Screen"
+msgstr "Schermo intero"
+
+#: ../wp-gpx-maps.php:426
+msgid "Exit Full Screen"
+msgstr "Torna a dimensioni originali"
+
+#: ../wp-gpx-maps.php:439
+msgid "Total distance"
+msgstr "Distanza totale"
+
+#: ../wp-gpx-maps.php:443
+msgid "Max elevation"
+msgstr "Altitudine massima"
+
+#: ../wp-gpx-maps.php:444
+msgid "Min elevation"
+msgstr "Altitudine minima"
+
+#: ../wp-gpx-maps.php:445
+msgid "Total climbing"
+msgstr "Totale salita"
+
+#: ../wp-gpx-maps.php:446
+msgid "Total descent"
+msgstr "Totale discesa"
+
+#: ../wp-gpx-maps.php:450
+msgid "Average speed"
+msgstr "Velocità media"
+
+#: ../wp-gpx-maps.php:466
+msgid "Download"
+msgstr "Scarica"
+
+#: ../wp-gpx-maps_admin_settings.php:75
+#: ../wp-gpx-maps_admin_settings.php:151
+#: ../wp-gpx-maps_admin_settings.php:255
+#: ../wp-gpx-maps_admin_settings.php:286
+msgid "Save Changes"
+msgstr "Salva"
+
diff --git a/languages/wp-gpx-maps.pot b/languages/wp-gpx-maps.pot
index 897fb4a..ab06ccc 100644
--- a/languages/wp-gpx-maps.pot
+++ b/languages/wp-gpx-maps.pot
@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: wp-gpx-maps\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-06-20 19:00+0100\n"
-"PO-Revision-Date: 2012-06-20 19:00+0100\n"
+"POT-Creation-Date: 2012-06-25 11:54+0100\n"
+"PO-Revision-Date: 2012-06-25 11:55+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -13,42 +13,66 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n"
-#: ../wp-gpx-maps.php:348
+#: ../wp-gpx-maps.php:420
msgid "Altitude"
msgstr ""
-#: ../wp-gpx-maps.php:349
+#: ../wp-gpx-maps.php:421
msgid "Current Position"
msgstr ""
-#: ../wp-gpx-maps.php:350
+#: ../wp-gpx-maps.php:422
msgid "Speed"
msgstr ""
-#: ../wp-gpx-maps.php:351
+#: ../wp-gpx-maps.php:423
msgid "Heart rate"
msgstr ""
-#: ../wp-gpx-maps.php:352
+#: ../wp-gpx-maps.php:424
msgid "Cadence"
msgstr ""
-#: ../wp-gpx-maps.php:353
+#: ../wp-gpx-maps.php:425
msgid "Go Full Screen"
msgstr ""
-#: ../wp-gpx-maps.php:354
+#: ../wp-gpx-maps.php:426
msgid "Exit Full Screen"
msgstr ""
-#: ../wp-gpx-maps.php:370
+#: ../wp-gpx-maps.php:439
+msgid "Total distance"
+msgstr ""
+
+#: ../wp-gpx-maps.php:443
+msgid "Max elevation"
+msgstr ""
+
+#: ../wp-gpx-maps.php:444
+msgid "Min elevation"
+msgstr ""
+
+#: ../wp-gpx-maps.php:445
+msgid "Total climbing"
+msgstr ""
+
+#: ../wp-gpx-maps.php:446
+msgid "Total descent"
+msgstr ""
+
+#: ../wp-gpx-maps.php:450
+msgid "Average speed"
+msgstr ""
+
+#: ../wp-gpx-maps.php:466
msgid "Download"
msgstr ""
-#: ../wp-gpx-maps_admin_settings.php:67
-#: ../wp-gpx-maps_admin_settings.php:143
-#: ../wp-gpx-maps_admin_settings.php:245
-#: ../wp-gpx-maps_admin_settings.php:276
+#: ../wp-gpx-maps_admin_settings.php:75
+#: ../wp-gpx-maps_admin_settings.php:151
+#: ../wp-gpx-maps_admin_settings.php:255
+#: ../wp-gpx-maps_admin_settings.php:286
msgid "Save Changes"
msgstr ""
diff --git a/readme.txt b/readme.txt
index 3c71090..3824867 100644
--- a/readme.txt
+++ b/readme.txt
@@ -89,7 +89,7 @@ The attributes are:
1. glinecolorcad: cadence line color (default is #beecff)
-1. uomspeed: the unit of measure of speed are: 0, 1, 2 (0 = m/s, 1 = km/h, 2 = miles/h)
+1. uomspeed: the unit of measure of speed are: 0, 1, 2, 3, 4 (0 = m/s, 1 = km/h, 2 = miles/h, 3 = min/km, 4 = min/miles)
1. chartFrom1: minimun value for altitude chart
@@ -115,6 +115,8 @@ The attributes are:
1. download: Allow users to download your GPX file
+1. summary: Print symmary details of your GPX (default is FALSE)
+
= What happening if I've a very large gpx? =
This plugin will print a small amout of points to speedup javascript and pageload.
diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php
index af9fac8..be3356a 100644
--- a/wp-gpx-maps.php
+++ b/wp-gpx-maps.php
@@ -70,6 +70,8 @@ function print_WP_GPX_Maps_scripts()
.wpgpxmaps img { max-width: none; width: none; padding:0; background:none; }
.wpgpxmaps .ngimages { display:none; }
.wpgpxmaps .myngimages { border:1px solid #fff;position:absolute;cursor:pointer;margin:0;z-index:1; }
+ .wpgpxmaps_summary .summarylabel { }
+ .wpgpxmaps_summary .summaryvalue { font-weight: bold; }
maxEle;
+ $min_ele = $points->minEle;
+ $total_ele_up = $points->totalEleUp;
+ $total_ele_down = $points->totalEleDown;
+ $avg_speed = $points->avgSpeed;
+ $tot_len = $points->totalLength;
foreach(array_keys($points->lat) as $i)
{
@@ -229,18 +253,9 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
if ($showSpeed == true) {
- $_speed = (float)$points->speed[$i]; // dafault m/s
+ $_speed = (float)$points->speed[$i];
- if ($uomspeed == '2') // miles/h
- {
- $_speed *= 2.2369362920544025;
- }
- else if ($uomspeed == '1') // km/h
- {
- $_speed *= 3.6;
- }
-
- $points_graph_speed .= $_speed.',';
+ $points_graph_speed .= convertSpeed($_speed,$uomspeed).',';
}
if ($showHr == true)
@@ -253,7 +268,36 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$points_graph_cad .= $points->cad[$i].',';
}
+ }
+
+ if ($uom == '1')
+ {
+ // Miles and feet
+ $tot_len = round($tot_len * 0.000621371192,2)." mi";
+ $max_ele = ($max_ele * 3.2808399)." ft";
+ $min_ele = ($min_ele * 3.2808399)." ft";
+ $total_ele_up = ($total_ele_up * 3.2808399)." ft";
+ $total_ele_down = ($total_ele_down * 3.2808399)." ft";
+ } else if ($uom == '2')
+ {
+ // meters / kilometers
+ $tot_len = round($tot_len / 1000,2)." km";
+ $max_ele = $max_ele ." m";
+ $min_ele = $min_ele ." m";
+ $total_ele_up = $total_ele_up ." m";
+ $total_ele_down = $total_ele_down ." m";
}
+ else
+ {
+ // meters / kilometers
+ $tot_len = $tot_len ." m";
+ $max_ele = $max_ele ." m";
+ $min_ele = $min_ele ." m";
+ $total_ele_up = $total_ele_up ." m";
+ $total_ele_down = $total_ele_down ." m";
+ }
+
+ $avg_speed = convertSpeed($avg_speed,$uomspeed,true);
if ($showW == true)
{
@@ -310,10 +354,17 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
"points_graph_speed" => $points_graph_speed,
"points_graph_hr" => $points_graph_hr,
"points_graph_cad" => $points_graph_cad,
- "waypoints" => $waypoints)
+ "waypoints" => $waypoints,
+ "max_ele" => $max_ele,
+ "min_ele" => $min_ele,
+ "total_ele_up" => $total_ele_up,
+ "total_ele_down" => $total_ele_down,
+ "avg_speed" => $avg_speed,
+ "tot_len" => $tot_len
+ )
),
LOCK_EX);
-
+
@chmod($gpxcache,0755);
$output = '
@@ -363,6 +414,30 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
});
';
+ // print summary
+ if ($summary=='true' && ( $points_graph_speed != '' || $points_graph_ele != '' || $points_graph_dist != '') )
+ {
+
+ $output .= "
diff --git a/wp-gpx-maps_admin_settings.php b/wp-gpx-maps_admin_settings.php index b1d030b..e0a2fcc 100644 --- a/wp-gpx-maps_admin_settings.php +++ b/wp-gpx-maps_admin_settings.php @@ -19,7 +19,8 @@ $showHr = get_option('wpgpxmaps_show_hr'); $showCad = get_option('wpgpxmaps_show_cadence'); $zoomonscrollwheel = get_option("wpgpxmaps_zoomonscrollwheel"); - $download = get_option("wpgpxmaps_download"); + $download = get_option("wpgpxmaps_download"); + $summary = get_option("wpgpxmaps_summary"); if (!($t)) $t = 'HYBRID'; @@ -56,14 +57,21 @@
- + " />
@@ -79,13 +87,13 @@