This commit is contained in:
parent
b108750b44
commit
0235961196
|
@ -357,20 +357,35 @@ function _wpgpxmaps(params)
|
||||||
var points = [];
|
var points = [];
|
||||||
var lastCut=0;
|
var lastCut=0;
|
||||||
var polylinenes = [];
|
var polylinenes = [];
|
||||||
|
var polyline_number=0;
|
||||||
|
var color=0;
|
||||||
for (i=0; i < mapData.length; i++)
|
for (i=0; i < mapData.length; i++)
|
||||||
{
|
{
|
||||||
if (mapData[i] == null)
|
if (mapData[i] == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ( polyline_number < color1.length )
|
||||||
|
{
|
||||||
|
color=color1[polyline_number];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color=color1[color1.length-1];
|
||||||
|
}
|
||||||
|
|
||||||
var poly = new google.maps.Polyline({
|
var poly = new google.maps.Polyline({
|
||||||
path: points.slice(lastCut,i),
|
path: points.slice(lastCut,i),
|
||||||
strokeColor: color1,
|
strokeColor: color,
|
||||||
strokeOpacity: .7,
|
strokeOpacity: .7,
|
||||||
strokeWeight: 4,
|
strokeWeight: 4,
|
||||||
map: map
|
map: map
|
||||||
});
|
});
|
||||||
polylinenes.push(poly);
|
polylinenes.push(poly);
|
||||||
lastCut=i;
|
lastCut=i;
|
||||||
|
polyline_number= polyline_number +1;
|
||||||
|
//var p = new google.maps.LatLng(mapData[i-1][0], mapData[i-1][1]);
|
||||||
|
//points.push(p);
|
||||||
|
//bounds.extend(p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -382,15 +397,24 @@ function _wpgpxmaps(params)
|
||||||
|
|
||||||
if (points.length != lastCut)
|
if (points.length != lastCut)
|
||||||
{
|
{
|
||||||
|
if ( polyline_number < color1.length)
|
||||||
|
{
|
||||||
|
color=color1[polyline_number];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color=color1[color1.length-1];
|
||||||
|
}
|
||||||
var poly = new google.maps.Polyline({
|
var poly = new google.maps.Polyline({
|
||||||
path: points.slice(lastCut),
|
path: points.slice(lastCut),
|
||||||
strokeColor: color1,
|
strokeColor: color,
|
||||||
strokeOpacity: .7,
|
strokeOpacity: .7,
|
||||||
strokeWeight: 4,
|
strokeWeight: 4,
|
||||||
map: map
|
map: map
|
||||||
});
|
});
|
||||||
polylinenes.push(poly);
|
polylinenes.push(poly);
|
||||||
currentPoints = [];
|
currentPoints = [];
|
||||||
|
polyline_number= polyline_number +1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startIcon != '')
|
if (startIcon != '')
|
||||||
|
@ -857,12 +881,18 @@ function getItemFromArray(arr,index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getClosestIndex(points,lat,lon)
|
function getClosestIndex(points,lat,lon)
|
||||||
{
|
{
|
||||||
var dd=10000;
|
var dd=10000;
|
||||||
var ii=0;
|
var ii=0;
|
||||||
for (i=0; i < points.length; i++)
|
for (i=0; i < points.length; i++)
|
||||||
{
|
{
|
||||||
|
if (points[i]==null)
|
||||||
|
continue;
|
||||||
|
|
||||||
var d = dist(points[i][0], points[i][1], lat, lon);
|
var d = dist(points[i][0], points[i][1], lat, lon);
|
||||||
if ( d < dd )
|
if ( d < dd )
|
||||||
{
|
{
|
||||||
|
|
12
readme.txt
12
readme.txt
|
@ -1,11 +1,11 @@
|
||||||
=== WP GPX Maps ===
|
=== WP GPX Maps ===
|
||||||
|
|
||||||
Contributors: bastianonm
|
Contributors: bastianonm
|
||||||
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8VHWLRW6JBTML
|
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8VHWLRW6JBTML
|
||||||
Tags: maps, gpx, gps, graph, chart, google maps, highcharts, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence
|
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
|
Requires at least: 2.0.0
|
||||||
Tested up to: 3.4
|
Tested up to: 3.4
|
||||||
Stable tag: 1.1.34
|
Stable tag: 1.1.35
|
||||||
License: GPLv2 or later
|
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
@ -54,7 +54,9 @@ Supported gpx namespaces are:
|
||||||
|
|
||||||
1. http://www.garmin.com/xmlschemas/TrackPointExtension/v1
|
1. http://www.garmin.com/xmlschemas/TrackPointExtension/v1
|
||||||
|
|
||||||
Thanks to: <a href="http://www.securcube.net/">www.securcube.net</a>, <a href="http://www.devfarm.it/">www.devfarm.it</a>, <a href="http://www.pedemontanadelgrappa.it/">www.pedemontanadelgrappa.it</a>,
|
Thanks to: <a href="http://www.securcube.net/">www.securcube.net</a>, <a href="http://www.devfarm.it/">www.devfarm.it</a>, <a href="http://www.pedemontanadelgrappa.it/">www.pedemontanadelgrappa.it</a>
|
||||||
|
|
||||||
|
Up to version 1.1.15 [Highcharts-API](http://www.highcharts.com/) is the only available rendering engine. Please respect their license and pricing (only Free for Non-Commercial usage).
|
||||||
|
|
||||||
== Installation ==
|
== Installation ==
|
||||||
|
|
||||||
|
@ -165,6 +167,10 @@ Yes!
|
||||||
1. Altitude & Speed & Hearth rate
|
1. Altitude & Speed & Hearth rate
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
= 1.1.35 =
|
||||||
|
* Fix: In the post list, sometime, the maps was not displaying correctly ( the php rand() function was not working?? )
|
||||||
|
* Various improvements for multi track gpx. Thanks to GPSracks.tv
|
||||||
|
* Summary table is now avaiable even without chart. Thanks to David
|
||||||
= 1.1.34 =
|
= 1.1.34 =
|
||||||
* 2 decimals for unit of measure min/km and min/mi
|
* 2 decimals for unit of measure min/km and min/mi
|
||||||
* translation file updated (a couple of phrases added)
|
* translation file updated (a couple of phrases added)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Plugin Name: WP-GPX-Maps
|
Plugin Name: WP-GPX-Maps
|
||||||
Plugin URI: http://www.darwinner.it/
|
Plugin URI: http://www.darwinner.it/
|
||||||
Description: Draws a gpx track with altitude graph
|
Description: Draws a gpx track with altitude graph
|
||||||
Version: 1.1.34
|
Version: 1.1.35
|
||||||
Author: Bastianon Massimo
|
Author: Bastianon Massimo
|
||||||
Author URI: http://www.pedemontanadelgrappa.it/
|
Author URI: http://www.pedemontanadelgrappa.it/
|
||||||
License: GPL
|
License: GPL
|
||||||
|
@ -145,7 +145,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
$p_avg_speed = findValue($attr, "summaryavgspeed", "wpgpxmaps_summary_avg_speed", false);
|
$p_avg_speed = findValue($attr, "summaryavgspeed", "wpgpxmaps_summary_avg_speed", false);
|
||||||
$p_total_time = findValue($attr, "summarytotaltime", "wpgpxmaps_summary_total_time", false);
|
$p_total_time = findValue($attr, "summarytotaltime", "wpgpxmaps_summary_total_time", false);
|
||||||
|
|
||||||
$r = rand(1,5000000);
|
$colors_map = "\"".implode("\",\"",(explode(" ",$color_map)))."\"";
|
||||||
|
|
||||||
$gpxurl = $gpx;
|
$gpxurl = $gpx;
|
||||||
|
|
||||||
|
@ -255,11 +255,12 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
$avg_speed = $points->avgSpeed;
|
$avg_speed = $points->avgSpeed;
|
||||||
$tot_len = $points->totalLength;
|
$tot_len = $points->totalLength;
|
||||||
|
|
||||||
foreach(array_keys($points->lat) as $i)
|
if (is_array ($points_x_lat))
|
||||||
|
foreach(array_keys($points_x_lat) as $i)
|
||||||
{
|
{
|
||||||
|
|
||||||
$_lat = (float)$points->lat[$i];
|
$_lat = (float)$points_x_lat[$i];
|
||||||
$_lon = (float)$points->lon[$i];
|
$_lon = (float)$points_x_lon[$i];
|
||||||
|
|
||||||
if ( $_lat == 0 && $_lon == 0 )
|
if ( $_lat == 0 && $_lon == 0 )
|
||||||
{
|
{
|
||||||
|
@ -278,7 +279,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$points_maps .= '['.(float)$points->lat[$i].','.(float)$points->lon[$i].'],';
|
$points_maps .= '['.(float)$points_x_lat[$i].','.(float)$points_x_lon[$i].'],';
|
||||||
|
|
||||||
$_ele = (float)$points->ele[$i];
|
$_ele = (float)$points->ele[$i];
|
||||||
$_dist = (float)$points->dist[$i];
|
$_dist = (float)$points->dist[$i];
|
||||||
|
@ -425,14 +426,10 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
@chmod($gpxcache,0755);
|
@chmod($gpxcache,0755);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($gh == "0" || $gh == "0px")
|
$hideGraph = ($gh == "0" || $gh == "0px");
|
||||||
{
|
|
||||||
$points_graph_dist = '';
|
global $post;
|
||||||
$points_graph_ele = '';
|
$r = $post->ID."_".rand(1,5000000);
|
||||||
$points_graph_speed = '';
|
|
||||||
$points_graph_hr = '';
|
|
||||||
$points_graph_cad = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$output = '
|
$output = '
|
||||||
<div id="wpgpxmaps_'.$r.'" class="wpgpxmaps">
|
<div id="wpgpxmaps_'.$r.'" class="wpgpxmaps">
|
||||||
|
@ -446,15 +443,15 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
wpgpxmaps({ targetId : "'.$r.'",
|
wpgpxmaps({ targetId : "'.$r.'",
|
||||||
mapType : "'.$mt.'",
|
mapType : "'.$mt.'",
|
||||||
mapData : ['.$points_maps.'],
|
mapData : ['.$points_maps.'],
|
||||||
graphDist : ['.$points_graph_dist.'],
|
graphDist : ['.($hideGraph ? '' : $points_graph_dist).'],
|
||||||
graphEle : ['.$points_graph_ele.'],
|
graphEle : ['.($hideGraph ? '' : $points_graph_ele).'],
|
||||||
graphSpeed : ['.$points_graph_speed.'],
|
graphSpeed : ['.($hideGraph ? '' : $points_graph_speed).'],
|
||||||
graphHr : ['.$points_graph_hr.'],
|
graphHr : ['.($hideGraph ? '' : $points_graph_hr).'],
|
||||||
graphCad : ['.$points_graph_cad.'],
|
graphCad : ['.($hideGraph ? '' : $points_graph_cad).'],
|
||||||
waypoints : ['.$waypoints.'],
|
waypoints : ['.$waypoints.'],
|
||||||
unit : "'.$uom.'",
|
unit : "'.$uom.'",
|
||||||
unitspeed : "'.$uomspeed.'",
|
unitspeed : "'.$uomspeed.'",
|
||||||
color1 : "'.$color_map.'",
|
color1 : ['.$colors_map.'],
|
||||||
color2 : "'.$color_graph.'",
|
color2 : "'.$color_graph.'",
|
||||||
color3 : "'.$color_graph_speed.'",
|
color3 : "'.$color_graph_speed.'",
|
||||||
color4 : "'.$color_graph_hr.'",
|
color4 : "'.$color_graph_hr.'",
|
||||||
|
|
Loading…
Reference in New Issue