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) function wpgpxmaps(targhetId,mapType,mapData,graphData)
{ {
var el = document.getElementById(targhetId); var el = document.getElementById(targhetId);
@ -17,14 +31,14 @@ function wpgpxmaps(targhetId,mapType,mapData,graphData)
if (graphData!= '') if (graphData!= '')
{ {
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('number', 'Lunghezza'); data.addColumn('number', loc['length']);
data.addColumn('number', 'Altezza'); data.addColumn('number', loc['altitude']);
data.addRows(graphData); data.addRows(graphData);
var chart = new google.visualization.AreaChart(el_chart); var chart = new google.visualization.AreaChart(el_chart);
var options = { curveType: "function", var options = { curveType: "function",
strictFirstColumnType: true, strictFirstColumnType: true,
hAxis : {format : '#,###m', title : "Lunghezza"}, hAxis : {format : '#,###m', title : loc['length']},
vAxis : {format : '#,###m', title : "Altitudine"}, vAxis : {format : '#,###m', title : loc['altitude']},
legend : {position : 'none'}, legend : {position : 'none'},
chartArea: {left:70,top:10,width:"100%",height:"75%"} 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 Tags: maps, gpx, graph, google maps, google chart
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.0.0 Stable tag: 1.0.1
License: GPLv2 or later License: GPLv2 or later
Add a gpx trak with altitude graph Add a gpx trak with altitude graph
== Description == == 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. 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.
You can also point the track and move your cursor both in the usual map or in the altitude map.
- Working also on iphone/ipad/ipod
WP-GPX-Maps WP-GPX-Maps
@ -46,7 +47,12 @@ Yes!
= 1.0.0 = = 1.0.0 =
* Initial release. * Initial release.
= 1.0.1 =
* Small changes on javascript localization.
== Upgrade Notice == == Upgrade Notice ==
= 1.0.0 = = 1.0.0 =
Initial release. Initial release.
= 1.0.1 =

View File

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