This commit is contained in:
bastianonm 2012-04-23 08:06:21 +00:00
parent 34ae53c75c
commit 6f36f1dc76
4 changed files with 36 additions and 14 deletions

View File

@ -448,6 +448,7 @@ function _wpgpxmaps(params)
plotOptions: {
area: {
fillOpacity: 0.1,
connectNulls : true,
marker: {
enabled: false,
symbol: 'circle',
@ -467,10 +468,12 @@ function _wpgpxmaps(params)
}
}
},
credits: {
enabled: false
},
yAxis: [],
series: []
};
if (graphEle != '')
{
@ -495,11 +498,13 @@ function _wpgpxmaps(params)
if ( chartFrom1 != '' )
{
yaxe.min = chartFrom1;
yaxe.startOnTick = false;
}
if ( chartTo1 != '' )
{
yaxe.max = chartTo1;
yaxe.endOnTick = false;
}
hoptions.yAxis.push(yaxe);
@ -554,11 +559,13 @@ function _wpgpxmaps(params)
if ( chartFrom2 != '' )
{
yaxe.min = chartFrom2;
yaxe.startOnTick = false;
}
if ( chartTo2 != '' )
{
yaxe.max = chartTo2;
yaxe.endOnTick = false;
}
hoptions.yAxis.push(yaxe);
@ -583,7 +590,10 @@ function _wpgpxmaps(params)
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 = {
@ -619,7 +629,10 @@ function _wpgpxmaps(params)
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 = {

View File

@ -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
Requires at least: 2.0.0
Tested up to: 3.3
Stable tag: 1.1.16
Stable tag: 1.1.17
License: GPLv2 or later
Draws a gpx track with altitude graph
@ -123,6 +123,9 @@ Yes!
2. Altitude & Speed & Hearth rate
== Changelog ==
= 1.1.17 =
* Remove zero values from cadence and heart rate charts
* nextgen gallery improvement
= 1.1.16 =
* Cadence chart (where available)
* minor bug fixes

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps
Plugin URI: http://www.darwinner.it/
Description: Draws a gpx track with altitude graph
Version: 1.1.16
Version: 1.1.17
Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/
License: GPL
@ -86,6 +86,8 @@ function findValue($attr, $attributeName, $optionName, $defaultValue)
function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
{
$error = '';
$gpx = findValue($attr, "gpx", "", "");
$w = findValue($attr, "width", "wpgpxmaps_width", "100%");
$mh = findValue($attr, "mheight", "wpgpxmaps_height", "450px");
@ -272,16 +274,13 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='')
$ngimgs_data = '';
if ( $ngGalleries != '' || $ngImages != '' )
{
$ngimgs = getNGGalleryImages($ngGalleries,$ngImages);
$ngimgs_data ='';
$ngimgs = getNGGalleryImages($ngGalleries, $ngImages, &$error);
$ngimgs_data ='';
foreach ($ngimgs as $img) {
$data = $img['data'];
$data = str_replace("\n","",$data);
$ngimgs_data .= '<span lat="'.$img['lat'].'" lon="'.$img['lon'].'">'.$data.'</span>';
}
}
@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="ngimages_'.$r.'" class="ngimages" style="display:none">'.$ngimgs_data.'</div>
</div>
'. $error .'
<script type="text/javascript">
jQuery(document).ready(function() {
wpgpxmaps({ targetId : "'.$r.'",

View File

@ -7,8 +7,9 @@
return is_plugin_active("nextgen-gallery/nggallery.php");
}
function getNGGalleryImages($ngGalleries, $ngImages)
function getNGGalleryImages($ngGalleries, $ngImages, &$error)
{
$result = array();
$galids = explode(',', $ngGalleries);
$imgids = explode(',', $ngImages);
@ -20,7 +21,7 @@
$pictures = array();
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) {
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) {
return '';
$error .= 'Error When Retrieving NextGen Gallery galleries/images: $e <br />';
}
return $result;
}