Version 1.3.9

Versione Retrieve waypoints in JSON, possibility to add a custom marker
This commit is contained in:
bastianonm 2015-12-17 10:56:23 +00:00
parent f1a3523a32
commit 7ec4369b82
4 changed files with 62 additions and 54 deletions

View File

@ -1,11 +1,11 @@
=== WP GPX Maps ===
Contributors: bastianonm, Stephan Klein
Contributors: bastianonm, Stephan Klein, Michel Selerin
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: 4.3.1
Stable tag: 1.3.8
Stable tag: 1.3.9
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map.
@ -195,6 +195,8 @@ Yes!
1. Altitude & Speed & Hearth rate
== Changelog ==
= 1.3.9 =
* Retrieve waypoints in JSON, possibility to add a custom marker (Changed by Michel Selerin)
= 1.3.8 =
* Improved Google Maps visualization
= 1.3.7 =

View File

@ -266,7 +266,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$mtime = 0;
}
$cacheFileName = "$gpx,$mtime,$w,$mh,$mt,$gh,$showEle,$showW,$showHr,$showAtemp,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,$distanceType,v1.3.5";
$cacheFileName = "$gpx,$mtime,$w,$mh,$mt,$gh,$showEle,$showW,$showHr,$showAtemp,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,$distanceType,v1.3.9";
$cacheFileName = md5($cacheFileName);
@ -511,12 +511,16 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
}
$avg_speed = convertSpeed($avg_speed,$uomspeed,true);
$waypoints = '[]';
if ($showW == true) {
$wpoints = getWayPoints($gpx);
/*
foreach ($wpoints as $p) {
$waypoints .= '['.number_format ( (float)$p[0] , 7 , '.' , '' ).','.number_format ( (float)$p[1] , 7 , '.' , '' ).',\''.unescape($p[4]).'\',\''.unescape($p[5]).'\',\''.unescape($p[7]).'\'],';
}
*/
$waypoints = json_encode($wpoints);
}
if ($showEle == "false")
@ -630,54 +634,57 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
</div>
'. $error .'
<script type="text/javascript">
jQuery("#wpgpxmaps_'.$r.'").wpgpxmaps({ targetId : "'.$r.'",
mapType : "'.$mt.'",
mapData : ['.$points_maps.'],
graphDist : ['.($hideGraph ? '' : $points_graph_dist).'],
graphEle : ['.($hideGraph ? '' : $points_graph_ele).'],
graphSpeed : ['.($hideGraph ? '' : $points_graph_speed).'],
graphHr : ['.($hideGraph ? '' : $points_graph_hr).'],
graphAtemp : ['.($hideGraph ? '' : $points_graph_atemp).'],
graphCad : ['.($hideGraph ? '' : $points_graph_cad).'],
graphGrade : ['.($hideGraph ? '' : $points_graph_grade).'],
waypoints : ['.$waypoints.'],
unit : "'.$uom.'",
unitspeed : "'.$uomspeed.'",
color1 : ['.$colors_map.'],
color2 : "'.$color_graph.'",
color3 : "'.$color_graph_speed.'",
color4 : "'.$color_graph_hr.'",
color5 : "'.$color_graph_cad.'",
color6 : "'.$color_graph_grade.'",
color7 : "'.$color_graph_atemp.'",
chartFrom1 : "'.$chartFrom1.'",
chartTo1 : "'.$chartTo1.'",
chartFrom2 : "'.$chartFrom2.'",
chartTo2 : "'.$chartTo2.'",
startIcon : "'.$startIcon.'",
endIcon : "'.$endIcon.'",
currentIcon : "'.$currentIcon.'",
waypointIcon : "'.$waypointIcon.'",
currentpositioncon : "'.$currentpositioncon.'",
usegpsposition : "'.$usegpsposition.'",
zoomOnScrollWheel : "'.$zoomOnScrollWheel.'",
ngGalleries : ['.$ngGalleries.'],
ngImages : ['.$ngImages.'],
pluginUrl : "'.plugins_url().'",
langs : { altitude : "'.__("Altitude", "wp-gpx-maps").'",
currentPosition : "'.__("Current Position", "wp-gpx-maps").'",
speed : "'.__("Speed", "wp-gpx-maps").'",
grade : "'.__("Grade", "wp-gpx-maps").'",
heartRate : "'.__("Heart rate", "wp-gpx-maps").'",
atemp : "'.__("Temperature", "wp-gpx-maps").'",
cadence : "'.__("Cadence", "wp-gpx-maps").'",
goFullScreen : "'.__("Go Full Screen", "wp-gpx-maps").'",
exitFullFcreen : "'.__("Exit Full Screen", "wp-gpx-maps").'",
hideImages : "'.__("Hide Images", "wp-gpx-maps").'",
showImages : "'.__("Show Images", "wp-gpx-maps").'",
backToCenter : "'.__("Back to center", "wp-gpx-maps").'"
}
});
jQuery(document).ready(function() {
jQuery("#wpgpxmaps_'.$r.'").wpgpxmaps({
targetId : "'.$r.'",
mapType : "'.$mt.'",
mapData : ['.$points_maps.'],
graphDist : ['.($hideGraph ? '' : $points_graph_dist).'],
graphEle : ['.($hideGraph ? '' : $points_graph_ele).'],
graphSpeed : ['.($hideGraph ? '' : $points_graph_speed).'],
graphHr : ['.($hideGraph ? '' : $points_graph_hr).'],
graphAtemp : ['.($hideGraph ? '' : $points_graph_atemp).'],
graphCad : ['.($hideGraph ? '' : $points_graph_cad).'],
graphGrade : ['.($hideGraph ? '' : $points_graph_grade).'],
waypoints : '.$waypoints.',
unit : "'.$uom.'",
unitspeed : "'.$uomspeed.'",
color1 : ['.$colors_map.'],
color2 : "'.$color_graph.'",
color3 : "'.$color_graph_speed.'",
color4 : "'.$color_graph_hr.'",
color5 : "'.$color_graph_cad.'",
color6 : "'.$color_graph_grade.'",
color7 : "'.$color_graph_atemp.'",
chartFrom1 : "'.$chartFrom1.'",
chartTo1 : "'.$chartTo1.'",
chartFrom2 : "'.$chartFrom2.'",
chartTo2 : "'.$chartTo2.'",
startIcon : "'.$startIcon.'",
endIcon : "'.$endIcon.'",
currentIcon : "'.$currentIcon.'",
waypointIcon : "'.$waypointIcon.'",
currentpositioncon : "'.$currentpositioncon.'",
usegpsposition : "'.$usegpsposition.'",
zoomOnScrollWheel : "'.$zoomOnScrollWheel.'",
ngGalleries : ['.$ngGalleries.'],
ngImages : ['.$ngImages.'],
pluginUrl : "'.plugins_url().'",
langs : { altitude : "'.__("Altitude", "wp-gpx-maps").'",
currentPosition : "'.__("Current Position", "wp-gpx-maps").'",
speed : "'.__("Speed", "wp-gpx-maps").'",
grade : "'.__("Grade", "wp-gpx-maps").'",
heartRate : "'.__("Heart rate", "wp-gpx-maps").'",
atemp : "'.__("Temperature", "wp-gpx-maps").'",
cadence : "'.__("Cadence", "wp-gpx-maps").'",
goFullScreen : "'.__("Go Full Screen", "wp-gpx-maps").'",
exitFullFcreen : "'.__("Exit Full Screen", "wp-gpx-maps").'",
hideImages : "'.__("Hide Images", "wp-gpx-maps").'",
showImages : "'.__("Show Images", "wp-gpx-maps").'",
backToCenter : "'.__("Back to center", "wp-gpx-maps").'"
}
});
});
</script>';
// print summary

View File

@ -584,7 +584,6 @@
$gpx->registerXPathNamespace('10', 'http://www.topografix.com/GPX/1/0');
$gpx->registerXPathNamespace('11', 'http://www.topografix.com/GPX/1/1');
$nodes = $gpx->xpath('//wpt | //10:wpt | //11:wpt');
global $wpdb;
if ( count($nodes) > 0 )