This commit is contained in:
bastianonm 2011-12-14 13:05:57 +00:00
parent 5000769327
commit 29bc44fe1a
3 changed files with 31 additions and 11 deletions

View File

@ -1,3 +1,17 @@
var loc_en =
{
"length" : "Length",
"altitude": "Altitude"
};
var loc_it =
{
"length" : "Lunghezza",
"altitude": "Altitudine"
};
var loc = loc_en;
function wpgpxmaps(targhetId,mapType,mapData,graphData)
{
var el = document.getElementById(targhetId);
@ -17,14 +31,14 @@ function wpgpxmaps(targhetId,mapType,mapData,graphData)
if (graphData!= '')
{
var data = new google.visualization.DataTable();
data.addColumn('number', 'Lunghezza');
data.addColumn('number', 'Altezza');
data.addColumn('number', loc['length']);
data.addColumn('number', loc['altitude']);
data.addRows(graphData);
var chart = new google.visualization.AreaChart(el_chart);
var options = { curveType: "function",
strictFirstColumnType: true,
hAxis : {format : '#,###m', title : "Lunghezza"},
vAxis : {format : '#,###m', title : "Altitudine"},
hAxis : {format : '#,###m', title : loc['length']},
vAxis : {format : '#,###m', title : loc['altitude']},
legend : {position : 'none'},
chartArea: {left:70,top:10,width:"100%",height:"75%"}
};

View File

@ -4,15 +4,16 @@ Donate link: http://www.darwinner.it/
Tags: maps, gpx, graph, google maps, google chart
Requires at least: 2.0.0
Tested up to: 3.3
Stable tag: 1.0.0
Stable tag: 1.0.1
License: GPLv2 or later
Add a gpx trak with altitude graph
== Description ==
This plugin has, as input, the GPX file with the track you've made. As output it shows the map of the track, fixed with an altitude map.
You can also point the track and move your cursor both in the usual map or in the altitude map.
This plugin has, as input, the GPX file with the track you've made. As output it shows the map of the track, fixed with an altitude graph.
- Working also on iphone/ipad/ipod
WP-GPX-Maps
@ -46,7 +47,12 @@ Yes!
= 1.0.0 =
* Initial release.
= 1.0.1 =
* Small changes on javascript localization.
== Upgrade Notice ==
= 1.0.0 =
Initial release.
= 1.0.1 =

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps
Plugin URI: http://www.darwinner.it/
Description: Add a gpx trak with altitude graph
Version: 1.0.0
Version: 1.0.1
Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/
License: GPL
@ -17,8 +17,8 @@ function enqueue_WP_GPX_Maps_scripts()
{
?>
<script type='text/javascript' src='https://www.google.com/jsapi?ver=3.2.1'></script>
<script type="text/javascript">
google.load("maps", "3", {other_params: "sensor=false"});
<script type='text/javascript'>
google.load('maps', '3', {other_params: 'sensor=false'});
google.load('visualization', '1', {'packages':['corechart']});
</script>
<script type='text/javascript' src='<?php echo plugins_url('/wp-gpx-maps.js', __FILE__) ?>'></script>