This commit is contained in:
parent
34ae53c75c
commit
6f36f1dc76
|
@ -448,6 +448,7 @@ function _wpgpxmaps(params)
|
||||||
plotOptions: {
|
plotOptions: {
|
||||||
area: {
|
area: {
|
||||||
fillOpacity: 0.1,
|
fillOpacity: 0.1,
|
||||||
|
connectNulls : true,
|
||||||
marker: {
|
marker: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
|
@ -467,11 +468,13 @@ function _wpgpxmaps(params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
credits: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
yAxis: [],
|
yAxis: [],
|
||||||
series: []
|
series: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (graphEle != '')
|
if (graphEle != '')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -495,11 +498,13 @@ function _wpgpxmaps(params)
|
||||||
if ( chartFrom1 != '' )
|
if ( chartFrom1 != '' )
|
||||||
{
|
{
|
||||||
yaxe.min = chartFrom1;
|
yaxe.min = chartFrom1;
|
||||||
|
yaxe.startOnTick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( chartTo1 != '' )
|
if ( chartTo1 != '' )
|
||||||
{
|
{
|
||||||
yaxe.max = chartTo1;
|
yaxe.max = chartTo1;
|
||||||
|
yaxe.endOnTick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
hoptions.yAxis.push(yaxe);
|
hoptions.yAxis.push(yaxe);
|
||||||
|
@ -554,11 +559,13 @@ function _wpgpxmaps(params)
|
||||||
if ( chartFrom2 != '' )
|
if ( chartFrom2 != '' )
|
||||||
{
|
{
|
||||||
yaxe.min = chartFrom2;
|
yaxe.min = chartFrom2;
|
||||||
|
yaxe.startOnTick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( chartTo2 != '' )
|
if ( chartTo2 != '' )
|
||||||
{
|
{
|
||||||
yaxe.max = chartTo2;
|
yaxe.max = chartTo2;
|
||||||
|
yaxe.endOnTick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
hoptions.yAxis.push(yaxe);
|
hoptions.yAxis.push(yaxe);
|
||||||
|
@ -583,7 +590,10 @@ function _wpgpxmaps(params)
|
||||||
|
|
||||||
for (i=0; i<valLen; i++)
|
for (i=0; i<valLen; i++)
|
||||||
{
|
{
|
||||||
hrData.push([graphDist[i],graphHr[i]]);
|
var c = graphHr[i];
|
||||||
|
if (c==0)
|
||||||
|
c = null;
|
||||||
|
hrData.push([graphDist[i],c]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var yaxe = {
|
var yaxe = {
|
||||||
|
@ -619,7 +629,10 @@ function _wpgpxmaps(params)
|
||||||
|
|
||||||
for (i=0; i<valLen; i++)
|
for (i=0; i<valLen; i++)
|
||||||
{
|
{
|
||||||
cadData.push([graphDist[i],graphCad[i]]);
|
var c = graphCad[i];
|
||||||
|
if (c==0)
|
||||||
|
c = null;
|
||||||
|
cadData.push([graphDist[i],c]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var yaxe = {
|
var yaxe = {
|
||||||
|
|
|
@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
||||||
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.3
|
Tested up to: 3.3
|
||||||
Stable tag: 1.1.16
|
Stable tag: 1.1.17
|
||||||
License: GPLv2 or later
|
License: GPLv2 or later
|
||||||
|
|
||||||
Draws a gpx track with altitude graph
|
Draws a gpx track with altitude graph
|
||||||
|
@ -123,6 +123,9 @@ Yes!
|
||||||
2. Altitude & Speed & Hearth rate
|
2. Altitude & Speed & Hearth rate
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
= 1.1.17 =
|
||||||
|
* Remove zero values from cadence and heart rate charts
|
||||||
|
* nextgen gallery improvement
|
||||||
= 1.1.16 =
|
= 1.1.16 =
|
||||||
* Cadence chart (where available)
|
* Cadence chart (where available)
|
||||||
* minor bug fixes
|
* minor bug fixes
|
||||||
|
|
|
@ -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.16
|
Version: 1.1.17
|
||||||
Author: Bastianon Massimo
|
Author: Bastianon Massimo
|
||||||
Author URI: http://www.pedemontanadelgrappa.it/
|
Author URI: http://www.pedemontanadelgrappa.it/
|
||||||
License: GPL
|
License: GPL
|
||||||
|
@ -86,6 +86,8 @@ function findValue($attr, $attributeName, $optionName, $defaultValue)
|
||||||
function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$error = '';
|
||||||
|
|
||||||
$gpx = findValue($attr, "gpx", "", "");
|
$gpx = findValue($attr, "gpx", "", "");
|
||||||
$w = findValue($attr, "width", "wpgpxmaps_width", "100%");
|
$w = findValue($attr, "width", "wpgpxmaps_width", "100%");
|
||||||
$mh = findValue($attr, "mheight", "wpgpxmaps_height", "450px");
|
$mh = findValue($attr, "mheight", "wpgpxmaps_height", "450px");
|
||||||
|
@ -272,16 +274,13 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
$ngimgs_data = '';
|
$ngimgs_data = '';
|
||||||
if ( $ngGalleries != '' || $ngImages != '' )
|
if ( $ngGalleries != '' || $ngImages != '' )
|
||||||
{
|
{
|
||||||
$ngimgs = getNGGalleryImages($ngGalleries,$ngImages);
|
$ngimgs = getNGGalleryImages($ngGalleries, $ngImages, &$error);
|
||||||
|
|
||||||
$ngimgs_data ='';
|
$ngimgs_data ='';
|
||||||
|
|
||||||
foreach ($ngimgs as $img) {
|
foreach ($ngimgs as $img) {
|
||||||
$data = $img['data'];
|
$data = $img['data'];
|
||||||
$data = str_replace("\n","",$data);
|
$data = str_replace("\n","",$data);
|
||||||
$ngimgs_data .= '<span lat="'.$img['lat'].'" lon="'.$img['lon'].'">'.$data.'</span>';
|
$ngimgs_data .= '<span lat="'.$img['lat'].'" lon="'.$img['lon'].'">'.$data.'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@file_put_contents($gpxcache,
|
@file_put_contents($gpxcache,
|
||||||
|
@ -303,6 +302,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
|
||||||
<div id="hchart_'.$r.'" class="plot" style="width:'.$w.'; height:'.$gh.'"></div>
|
<div id="hchart_'.$r.'" class="plot" style="width:'.$w.'; height:'.$gh.'"></div>
|
||||||
<div id="ngimages_'.$r.'" class="ngimages" style="display:none">'.$ngimgs_data.'</div>
|
<div id="ngimages_'.$r.'" class="ngimages" style="display:none">'.$ngimgs_data.'</div>
|
||||||
</div>
|
</div>
|
||||||
|
'. $error .'
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
wpgpxmaps({ targetId : "'.$r.'",
|
wpgpxmaps({ targetId : "'.$r.'",
|
||||||
|
|
|
@ -7,8 +7,9 @@
|
||||||
return is_plugin_active("nextgen-gallery/nggallery.php");
|
return is_plugin_active("nextgen-gallery/nggallery.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNGGalleryImages($ngGalleries, $ngImages)
|
function getNGGalleryImages($ngGalleries, $ngImages, &$error)
|
||||||
{
|
{
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
$galids = explode(',', $ngGalleries);
|
$galids = explode(',', $ngGalleries);
|
||||||
$imgids = explode(',', $ngImages);
|
$imgids = explode(',', $ngImages);
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
|
|
||||||
$pictures = array();
|
$pictures = array();
|
||||||
foreach ($galids as $g) {
|
foreach ($galids as $g) {
|
||||||
$pictures = array_merge($pictures, nggdb::get_gallery($g, false, false, true, $capture_date));
|
$pictures = array_merge($pictures, nggdb::get_gallery($g));
|
||||||
}
|
}
|
||||||
foreach ($imgids as $i) {
|
foreach ($imgids as $i) {
|
||||||
array_push($pictures, nggdb::find_image($i));
|
array_push($pictures, nggdb::find_image($i));
|
||||||
|
@ -41,11 +42,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error .= "Sorry, <a href='http://php.net/manual/en/function.exif-read-data.php' target='_blank' >exif_read_data</a> function not found! check your hosting..<br />";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return '';
|
$error .= 'Error When Retrieving NextGen Gallery galleries/images: $e <br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue