renamed javascript functions to avoid collision with other plugins
reduced chart line thickness
This commit is contained in:
parent
60b8c67a56
commit
31066887ac
|
@ -2,7 +2,7 @@
|
|||
Plugin Name: WP-GPX-Maps
|
||||
Plugin URI: http://www.devfarm.it/
|
||||
Description: Draws a gpx track with altitude graph
|
||||
Version: 1.5.02
|
||||
Version: 1.5.05
|
||||
Author: Bastianon Massimo
|
||||
Author URI: http://www.devfarm.it/
|
||||
*/
|
||||
|
@ -778,6 +778,7 @@ Author URI: http://www.devfarm.it/
|
|||
data: {
|
||||
datasets: [],
|
||||
},
|
||||
borderWidth: 1,
|
||||
options: {
|
||||
animation: {
|
||||
//duration: 0, // general animation time
|
||||
|
@ -958,7 +959,7 @@ Author URI: http://www.devfarm.it/
|
|||
}
|
||||
_formats.push(l_y)
|
||||
hoptions.options.scales.yAxes.push(yaxe);
|
||||
hoptions.data.datasets.push( getDataset(lng.altitude, myData.Items, color2, yaxe.id ));
|
||||
hoptions.data.datasets.push( wpgpxmapsGetDataset(lng.altitude, myData.Items, color2, yaxe.id ));
|
||||
|
||||
}
|
||||
|
||||
|
@ -1028,7 +1029,7 @@ Author URI: http://www.devfarm.it/
|
|||
|
||||
_formats.push(l_s);
|
||||
hoptions.options.scales.yAxes.push(yaxe);
|
||||
hoptions.data.datasets.push( getDataset(lng.speed, myData.Items, color3, yaxe.id ) );
|
||||
hoptions.data.datasets.push( wpgpxmapsGetDataset(lng.speed, myData.Items, color3, yaxe.id ) );
|
||||
|
||||
}
|
||||
|
||||
|
@ -1051,7 +1052,7 @@ Author URI: http://www.devfarm.it/
|
|||
};
|
||||
|
||||
hoptions.options.scales.yAxes.push(yaxe);
|
||||
hoptions.data.datasets.push( getDataset(lng.heartRate, myData.Items, color4, yaxe.id ) );
|
||||
hoptions.data.datasets.push( wpgpxmapsGetDataset(lng.heartRate, myData.Items, color4, yaxe.id ) );
|
||||
_formats.push(l_hr);
|
||||
}
|
||||
|
||||
|
@ -1075,7 +1076,7 @@ Author URI: http://www.devfarm.it/
|
|||
};
|
||||
|
||||
hoptions.options.scales.yAxes.push(yaxe);
|
||||
hoptions.data.datasets.push( getDataset(lng.atemp, myData,Items, color7, yaxe.id ) );
|
||||
hoptions.data.datasets.push( wpgpxmapsGetDataset(lng.atemp, myData,Items, color7, yaxe.id ) );
|
||||
_formats.push({ suf : "°C", dec : 1 });
|
||||
|
||||
}
|
||||
|
@ -1100,7 +1101,7 @@ Author URI: http://www.devfarm.it/
|
|||
};
|
||||
|
||||
hoptions.options.scales.yAxes.push(yaxe);
|
||||
hoptions.data.datasets.push( getDataset(lng.cadence, myData.Items, color5, yaxe.id) );
|
||||
hoptions.data.datasets.push( wpgpxmapsGetDataset(lng.cadence, myData.Items, color5, yaxe.id) );
|
||||
_formats.push(l_cad);
|
||||
|
||||
}
|
||||
|
@ -1125,7 +1126,7 @@ Author URI: http://www.devfarm.it/
|
|||
|
||||
_formats.push(l_grade);
|
||||
hoptions.options.scales.yAxes.push(yaxe);
|
||||
hoptions.data.datasets.push( getDataset(lng.grade, myData.Items, color6, yaxe.id ) );
|
||||
hoptions.data.datasets.push( wpgpxmapsGetDataset(lng.grade, myData.Items, color6, yaxe.id ) );
|
||||
|
||||
}
|
||||
|
||||
|
@ -1180,14 +1181,14 @@ Author URI: http://www.devfarm.it/
|
|||
|
||||
}
|
||||
|
||||
function getDataset(name,data,color, id) {
|
||||
function wpgpxmapsGetDataset(name,data,color, id) {
|
||||
return {
|
||||
label: name,
|
||||
data : data,
|
||||
borderColor: color,
|
||||
backgroundColor: hexToRgbA(color, .3),
|
||||
pointRadius: 0,
|
||||
borderWidth: 0,
|
||||
borderWidth: 1,
|
||||
pointHoverRadius: 1,
|
||||
yAxisID: id,
|
||||
}
|
||||
|
@ -1273,7 +1274,7 @@ Author URI: http://www.devfarm.it/
|
|||
if (points[i]==null)
|
||||
continue;
|
||||
|
||||
var d = dist(points[i][0], points[i][1], lat, lon);
|
||||
var d = wpgpxmapsDist(points[i][0], points[i][1], lat, lon);
|
||||
if ( d < dd )
|
||||
{
|
||||
ii = i;
|
||||
|
@ -1296,7 +1297,7 @@ Author URI: http://www.devfarm.it/
|
|||
imageLat = imageLat.replace(",", ".");
|
||||
imageLon = imageLon.replace(",", ".");
|
||||
|
||||
var d = dist(imageLat, imageLon, lat, lon);
|
||||
var d = wpgpxmapsDist(imageLat, imageLon, lat, lon);
|
||||
if ( d < dd )
|
||||
{
|
||||
img = img_spans[i];
|
||||
|
@ -1311,7 +1312,7 @@ Author URI: http://www.devfarm.it/
|
|||
return (RE.test(input));
|
||||
}
|
||||
|
||||
function dist(lat1,lon1,lat2,lon2)
|
||||
function wpgpxmapsDist(lat1,lon1,lat2,lon2)
|
||||
{
|
||||
// mathematically not correct but fast
|
||||
var dLat = (lat2-lat1);
|
||||
|
|
|
@ -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
|
||||
Requires at least: 2.0.0
|
||||
Tested up to: 4.9.4
|
||||
Stable tag: 1.5.04
|
||||
Stable tag: 1.5.05
|
||||
|
||||
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map.
|
||||
|
||||
|
@ -153,6 +153,9 @@ Yes!
|
|||
1. Altitude & Speed & Hearth rate
|
||||
|
||||
== Changelog ==
|
||||
= 1.5.05 =
|
||||
* renamed javascript functions to avoid collision with other plugins
|
||||
* reduced chart line thickness
|
||||
= 1.5.04 =
|
||||
* fix uom
|
||||
* fix file not found
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Plugin Name: WP-GPX-Maps
|
||||
Plugin URI: http://www.devfarm.it/
|
||||
Description: Draws a GPX track with altitude chart
|
||||
Version: 1.5.04
|
||||
Version: 1.5.05
|
||||
Author: Bastianon Massimo
|
||||
Author URI: http://www.devfarm.it/
|
||||
*/
|
||||
|
@ -62,7 +62,7 @@ function enqueue_WP_GPX_Maps_scripts_admin($hook)
|
|||
function enqueue_WP_GPX_Maps_scripts() {
|
||||
|
||||
wp_register_script('chartjs', plugins_url( '/js/Chart.min.js', __FILE__ ), array(), "2.7.2" );
|
||||
wp_register_script('WP-GPX-Maps', plugins_url( '/js/WP-GPX-Maps.js', __FILE__ ), array('jquery','googlemaps','chartjs'), "1.5.031" );
|
||||
wp_register_script('WP-GPX-Maps', plugins_url( '/js/WP-GPX-Maps.js', __FILE__ ), array('jquery','googlemaps','chartjs'), "1.5.05" );
|
||||
|
||||
$wpgpxmaps_googlemapsv3_apikey = get_option('wpgpxmaps_googlemapsv3_apikey');
|
||||
|
||||
|
|
Loading…
Reference in New Issue