diff --git a/WP-GPX-Maps.js b/WP-GPX-Maps.js index 5ee2544..e97bd02 100644 --- a/WP-GPX-Maps.js +++ b/WP-GPX-Maps.js @@ -3,18 +3,14 @@ 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("wpgpxmaps_" + targhetId); var el_map = document.getElementById("map_" + targhetId); var el_chart = document.getElementById("chart_" + targhetId); diff --git a/readme.txt b/readme.txt index c17a371..ea05a48 100644 --- a/readme.txt +++ b/readme.txt @@ -1,64 +1,59 @@ === WP-GPX-Maps === Contributors: bastianonm -Donate link: http://www.darwinner.it/ -Tags: maps, gpx, graph, google maps, google chart +Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=bastianonm@hotmail.com&item_name=WP-GRX-Maps&item_number=WP-GRX-Maps&amount=5¤cy_code=EUR +Tags: maps, gpx, gps, graph, google maps, google chart Requires at least: 2.0.0 Tested up to: 3.3 -Stable tag: 1.0.2 +Stable tag: 1.0.3 License: GPLv2 or later -Add a gpx track with altitude graph +Draws a gpx track 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 graph. - -- Also working on iphone/ipad/ipod - +- iphone/ipad/ipod Compatible Try this plugin on http://www.pedemontanadelgrappa.it/category/mappe/ - Thanks to: www.securcube.net, www.darwinner.it, www.pedemontanadelgrappa.it, - Bugs, problems, thanks and anything else here! - == Installation == - 1. Use the classic wordpress plugin installer or copy the plugins folder to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' menu in WordPress 1. Add the shortcode [sgpx gpx=">relative path to your gpx<"] == Frequently Asked Questions == += what are all available shortcode attributes? = +The attributes are: +1. gpx: relative path to gpx +1. width: width in pixels +1. mheight: map height +1. gheight: graph height +1. mtype: map aviable types are: HYBRID, ROADMAP, SATELLITE, TERRAIN +shortcode with all the attributes : [sgpx gpx=">relative path to your gpx<" width=100% mheight=300px gheight=200px mtype=SATELLITE] = What happening if I've a very large gpx? = - This plugin will print a small amout of points to to speedup javascript and pageload. - = Is it free? = - Yes! == Screenshots == - 1. Screenshot Sample 2. Screenshot Admin area == Changelog == - += 1.0.3 = +* Added Settings link on plugins list +* Added attributes width, mheight, gheight, mtype on shortcode. += 1.0.2 = +* You can manage your gpx files in the admin area. += 1.0.1 = +* Small changes on javascript localization. = 1.0.0 = * Initial release. -= 1.0.1 = -* Small changes on javascript localization. - -= 1.0.2 = -* You can manage your gpx files in the admin area. - == Upgrade Notice == - -= 1.0.0 = -Initial release. - -= 1.0.1 = - += 1.0.3 = = 1.0.2 = += 1.0.1 = += 1.0.0 = +Initial release. \ No newline at end of file diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php index b9048b8..e4b7592 100644 --- a/wp-gpx-maps.php +++ b/wp-gpx-maps.php @@ -2,16 +2,39 @@ /* Plugin Name: WP-GPX-Maps Plugin URI: http://www.darwinner.it/ -Description: Add a gpx track with altitude graph -Version: 1.0.2 +Description: Draws a gpx track with altitude graph +Version: 1.0.3 Author: Bastianon Massimo Author URI: http://www.pedemontanadelgrappa.it/ License: GPL */ include 'wp-gpx-maps_Utils.php'; +include 'wp-gpx-maps_admin.php'; add_action( 'wp_print_scripts', 'enqueue_WP_GPX_Maps_scripts' ); +add_shortcode('sgpx','handle_WP_GPX_Maps_Shortcodes'); +register_activation_hook(__FILE__,'WP_GPX_Maps_install'); +register_deactivation_hook( __FILE__, 'WP_GPX_Maps_remove'); +add_filter('plugin_action_links', 'WP_GPX_Maps_action_links', 10, 2); + +function WP_GPX_Maps_action_links($links, $file) { + static $this_plugin; + + if (!$this_plugin) { + $this_plugin = plugin_basename(__FILE__); + } + + // check to make sure we are on the correct plugin + if ($file == $this_plugin) { + // the anchor tag and href to the URL we want. For a "Settings" link, this needs to be the url of your settings page + $settings_link = 'Settings'; + // add the link to the list + array_unshift($links, $settings_link); + } + + return $links; +} function enqueue_WP_GPX_Maps_scripts() { @@ -25,15 +48,38 @@ function enqueue_WP_GPX_Maps_scripts() -
- + + '; } -register_activation_hook(__FILE__,'WP_GPX_Maps_install'); -register_deactivation_hook( __FILE__, 'WP_GPX_Maps_remove'); - function WP_GPX_Maps_install() { add_option("wpgpxmaps_width", '100%', '', 'yes'); + add_option("wpgpxmaps_graph_height", '200px', '', 'yes'); add_option("wpgpxmaps_height", '450px', '', 'yes'); add_option('wpgpxmaps_map_type','HYBRID','','yes'); } function WP_GPX_Maps_remove() { delete_option('wpgpxmaps_width'); + delete_option('wpgpxmaps_graph_height'); delete_option('wpgpxmaps_height'); delete_option('wpgpxmaps_map_type'); } -if ( is_admin() ){ - - add_action('admin_menu', 'wpgpxmaps_admin_menu'); - - function wpgpxmaps_admin_menu() { - add_options_page('WP GPX Maps', 'WP GPX Maps', 'administrator', 'WP-GPX-Maps', 'WP_GPX_Maps_html_page'); - } -} - -function WP_GPX_Maps_html_page() { - - $realGpxPath = substr (__FILE__, 0, strrpos(__FILE__,'/wp-content/'))."/wp-content/uploads/gpx"; - $gpxRegEx = '/.gpx$/'; - ?> - -File | -Last modified | -File size (Byte) | -
---|---|---|
File | -Last modified | -File size (Byte) | -
+ Full set of attributes: [sgpx gpx="/wp-content/uploads/gpx/< gpx file name >" width=100% mheight=450px gheight=200px mtype=SATELLITE] +