* Fix: Garmin cadence

* Infowindows closing on mouseout
This commit is contained in:
bastianonm 2014-07-09 15:55:55 +00:00
parent 533bbc41f1
commit 2af057702a
4 changed files with 26 additions and 26 deletions

View File

@ -1199,6 +1199,14 @@ Author URI: http://www.pedemontanadelgrappa.it/
infowindow = new google.maps.InfoWindow({ content: cnt}); infowindow = new google.maps.InfoWindow({ content: cnt});
infowindow.open(map,m); infowindow.open(map,m);
}); });
google.maps.event.addListener(m, "mouseout", function () {
if (infowindow)
{
infowindow.close();
}
});
} }
function getItemFromArray(arr,index) function getItemFromArray(arr,index)

View File

@ -5,7 +5,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: maps, gpx, gps, graph, chart, google maps, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence 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 Requires at least: 2.0.0
Tested up to: 3.9 Tested up to: 3.9
Stable tag: 1.3.3 Stable tag: 1.3.4
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map.
@ -187,6 +187,9 @@ Yes!
1. Altitude & Speed & Hearth rate 1. Altitude & Speed & Hearth rate
== Changelog == == Changelog ==
= 1.3.4 =
* Fix: Garmin cadence
* Infowindows closing on mouseout
= 1.3.3 = = 1.3.3 =
* Add feet/Nautical Miles units (thanks to elperepat) * Add feet/Nautical Miles units (thanks to elperepat)
* Update OpenStreetMaps Credits * Update OpenStreetMaps Credits

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps Plugin Name: WP-GPX-Maps
Plugin URI: http://www.devfarm.it/ Plugin URI: http://www.devfarm.it/
Description: Draws a GPX track with altitude chart Description: Draws a GPX track with altitude chart
Version: 1.3.3 Version: 1.3.4
Author: Bastianon Massimo Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/ Author URI: http://www.pedemontanadelgrappa.it/
*/ */
@ -249,7 +249,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$gpxurl = $gpx; $gpxurl = $gpx;
$cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showEle,$showW,$showHr,$showAtemp,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,$distanceType,v1.2.7"; $cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showEle,$showW,$showHr,$showAtemp,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,$distanceType,v1.3.4";
$cacheFileName = md5($cacheFileName); $cacheFileName = md5($cacheFileName);

View File

@ -201,32 +201,21 @@
if (isset($trkpt->extensions)) if (isset($trkpt->extensions))
{ {
$trkpt->registerXPathNamespace('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1'); $trkpt->registerXPathNamespace('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
$_hr = @$trkpt->xpath('extensions/gpxtpx:TrackPointExtension/gpxtpx:hr/text() | extensions/TrackPointExtension/hr/text()'); $_ext = @$trkpt->xpath('extensions/gpxtpx:TrackPointExtension | extensions/TrackPointExtension');
if ($_hr)
if ($_ext)
{ {
foreach ($_hr as $node) { if ($_ext[0])
$hr = (float)$node; {
$hr = @$_ext[0]->hr;
$atemp = @$_ext[0]->atemp;
$cad = @$_ext[0]->cad;
} }
} }
$_atemp = @$trkpt->xpath('extensions/gpxtpx:TrackPointExtension/gpxtpx:atemp/text() | extensions/TrackPointExtension/atemp/text()');
if ($_atemp)
{
foreach ($_atemp as $node) {
$atemp = (float)$node;
}
}
$_cad = @$trkpt->xpath('extensions/gpxtpx:TrackPointExtension/gpxtpx:cad/text() | extensions/TrackPointExtension/cad/text()');
if ($_cad)
{
foreach ($_cad as $node) {
$cad = (float)$node;
}
}
} }
if ($lastLat == 0 && $lastLon == 0) if ($lastLat == 0 && $lastLon == 0)
@ -239,9 +228,9 @@
array_push($points->ele, (float)round($ele,2)); array_push($points->ele, (float)round($ele,2));
array_push($points->dist, (float)round($dist,2)); array_push($points->dist, (float)round($dist,2));
array_push($points->speed, 0); array_push($points->speed, 0);
array_push($points->hr, $hr); array_push($points->hr, (float)$hr);
array_push($points->atemp, $atemp); array_push($points->atemp, (float)$atemp);
array_push($points->cad, $cad); array_push($points->cad, (float)$cad);
array_push($points->grade, $grade); array_push($points->grade, $grade);
$lastLat=$lat; $lastLat=$lat;