From b3344dbd33b3168167a3fa129f089fbd121cb00a Mon Sep 17 00:00:00 2001 From: bastianonm Date: Thu, 21 Jun 2012 13:29:17 +0000 Subject: [PATCH] --- WP-GPX-Maps.js | 135 ++++++++++++++++++--------------- img/expand.png | Bin 0 -> 1494 bytes img/redo.png | Bin 0 -> 3542 bytes languages/wp-gpx-maps-it_IT.mo | Bin 0 -> 857 bytes languages/wp-gpx-maps-it_IT.po | 56 ++++++++++++++ languages/wp-gpx-maps.pot | 54 +++++++++++++ readme.txt | 14 +++- wp-gpx-maps.php | 39 +++++++--- wp-gpx-maps_admin.php | 1 + wp-gpx-maps_admin_settings.php | 17 +++-- 10 files changed, 238 insertions(+), 78 deletions(-) create mode 100644 img/expand.png create mode 100644 img/redo.png create mode 100644 languages/wp-gpx-maps-it_IT.mo create mode 100644 languages/wp-gpx-maps-it_IT.po create mode 100644 languages/wp-gpx-maps.pot diff --git a/WP-GPX-Maps.js b/WP-GPX-Maps.js index 065568d..b975632 100644 --- a/WP-GPX-Maps.js +++ b/WP-GPX-Maps.js @@ -42,7 +42,6 @@ function setup() CustomMarker = function( map, latlng, src, img_w, img_h) { this.latlng_ = latlng; - this.setMap(map); this.src_ = src; this.img_w_ = img_w; @@ -118,55 +117,6 @@ function setup() } -function FullScreenControl(controlDiv, map) { - - // Set CSS styles for the DIV containing the control - // Setting padding to 5 px will offset the control - // from the edge of the map - controlDiv.style.padding = '5px'; - - // Set CSS for the control border - var controlUI = document.createElement('div'); - controlUI.style.backgroundColor = 'white'; - controlUI.style.borderStyle = 'solid'; - controlUI.style.borderWidth = '2px'; - controlUI.style.cursor = 'pointer'; - controlUI.style.textAlign = 'center'; - controlUI.title = 'Go full screen'; - controlDiv.appendChild(controlUI); - - // Set CSS for the control interior - var controlText = document.createElement('div'); - controlText.style.fontFamily = 'Arial,sans-serif'; - controlText.style.fontSize = '12px'; - controlText.style.paddingLeft = '4px'; - controlText.style.paddingRight = '4px'; - controlText.innerHTML = 'Full Screen'; - controlUI.appendChild(controlText); - - // Setup the click event listeners: simply set the map to - // Chicago - google.maps.event.addDomListener(controlUI, 'click', function(event) { - var isFullScreen = (controlUI.isfullscreen == true); - var fullScreenCss = "position: absolute;left:0;top:0;"; - var mapDiv = map.getDiv(); - if (isFullScreen) - { - jQuery(mapDiv).attr('oldStyle', jQuery(mapDiv).attr('style')); - jQuery(mapDiv).attr('style', fullScreenCss); - jQuery(controlUI).html("Exit Full Screen"); - } - else - { - jQuery(mapDiv).attr('style', jQuery(mapDiv).attr('oldStyle')); - jQuery(controlUI).html("Full Screen"); - } - controlUI.isfullscreen = !isFullScreen; - }); - -} - - function _wpgpxmaps(params) { @@ -191,9 +141,12 @@ function _wpgpxmaps(params) var chartFrom2 = params.chartFrom2; var chartTo2 = params.chartTo2; var startIcon = params.startIcon; + var waypointIcon = params.waypointIcon; var endIcon = params.endIcon; var currentIcon = params.currentIcon; var zoomOnScrollWheel = params.zoomOnScrollWheel; + var lng = params.langs; + var pluginUrl = params.pluginUrl; var el = document.getElementById("wpgpxmaps_" + targetId); var el_map = document.getElementById("map_" + targetId); @@ -256,16 +209,71 @@ function _wpgpxmaps(params) maxZoom: 18 })); - //var fullScreenControlDiv = document.createElement('div'); - //var fullScreenControl = new FullScreenControl(fullScreenControlDiv, map); - //fullScreenControlDiv.index = 1; - //map.controls[google.maps.ControlPosition.TOP_RIGHT].push(fullScreenControlDiv); + // FULL SCREEN BUTTON + var controlDiv = document.createElement('div'); + controlDiv.style.padding = '5px'; + + + // Set CSS for the control border + var controlUI = document.createElement('img'); + controlUI.src = pluginUrl + "/wp-gpx-maps/img/expand.png"; + controlUI.style.cursor = 'pointer'; + controlUI.title = lng.gofullscreen; + controlDiv.appendChild(controlUI); + + // Setup the click event listeners: simply set the map to + // Chicago + google.maps.event.addDomListener(controlUI, 'click', function(event) { + var isFullScreen = (controlUI.isfullscreen == true); + var fullScreenCss = "position: absolute;left:0;top:0;"; + var mapDiv = map.getDiv(); + var center = map.getCenter(); + + if (isFullScreen) + { + map.setOptions( { scrollwheel : (zoomOnScrollWheel == 'true') } ); + jQuery(mapDiv).css("position", 'relative'). + css('top', 0). + css("width", controlUI.googleMapWidth). + css("height", controlUI.googleMapHeight). + css("z-index", ''); + google.maps.event.trigger(map, 'resize'); + map.setCenter(center); + controlUI.src = pluginUrl + "/wp-gpx-maps/img/expand.png"; + controlUI.title = lng.gofullscreen; + } + else + { + map.setOptions( { scrollwheel : true } ); + controlUI.googleMapWidth = jQuery(mapDiv).css('width'); + controlUI.googleMapHeight = jQuery(mapDiv).css('height'); + jQuery(mapDiv).css("position", 'fixed'). + css('top', 0). + css('left', 0). + css("width", '100%'). + css("height", '100%'). + css("z-index", '99999'); + jQuery("#wpadminbar").each(function(){ + jQuery(mapDiv).css('top', jQuery(this).height()); + }); + google.maps.event.trigger(map, 'resize'); + map.setCenter(center); + controlUI.src = pluginUrl + "/wp-gpx-maps/img/redo.png"; + controlUI.title = lng.exitfullscreen; + } + controlUI.isfullscreen = !isFullScreen; + return false; + }); + + controlDiv.index = 1; + map.controls[google.maps.ControlPosition.TOP_RIGHT].push(controlDiv); var bounds = new google.maps.LatLngBounds(); // Print WayPoints if (waypoints != '') { + var image = new google.maps.MarkerImage('http://maps.google.com/mapfiles/ms/micons/flag.png', new google.maps.Size(32, 32), new google.maps.Point(0,0), @@ -276,6 +284,13 @@ function _wpgpxmaps(params) new google.maps.Point(0,0), new google.maps.Point(16, 32) ); + + if (waypointIcon!='') + { + image = new google.maps.MarkerImage(waypointIcon); + shadow = ''; + } + for (i=0; i < waypoints.length; i++) { addWayPoint(map, image, shadow, waypoints[i][0], waypoints[i][1], waypoints[i][2], waypoints[i][3]); @@ -396,7 +411,7 @@ function _wpgpxmaps(params) if (marker) { marker.setPosition(event.latLng); - marker.setTitle("Current Position"); + marker.setTitle(lng.currentPosition); if (hchart) { var tooltip = hchart.tooltip; @@ -485,7 +500,7 @@ function _wpgpxmaps(params) { var point = getItemFromArray(mapData,i) marker.setPosition(new google.maps.LatLng(point[0],point[1])); - marker.setTitle("Current Position"); + marker.setTitle(lng.currentPosition); i+=10000000; } } @@ -563,7 +578,7 @@ function _wpgpxmaps(params) hoptions.yAxis.push(yaxe); hoptions.series.push({ - name: 'Altitude', + name: lng.altitude, lineWidth: 1, marker: { radius: 0 }, data : eleData, @@ -624,7 +639,7 @@ function _wpgpxmaps(params) hoptions.yAxis.push(yaxe); hoptions.series.push({ - name: 'Speed', + name: lng.speed, lineWidth: 1, marker: { radius: 0 }, data : speedData, @@ -663,7 +678,7 @@ function _wpgpxmaps(params) hoptions.yAxis.push(yaxe); hoptions.series.push({ - name: 'Heart rate', + name: lng.heartRate, lineWidth: 1, marker: { radius: 0 }, data : hrData, @@ -702,7 +717,7 @@ function _wpgpxmaps(params) hoptions.yAxis.push(yaxe); hoptions.series.push({ - name: 'Cadence', + name: lng.cadence, lineWidth: 1, marker: { radius: 0 }, data : cadData, diff --git a/img/expand.png b/img/expand.png new file mode 100644 index 0000000000000000000000000000000000000000..2686b14868ffb36bdaadec84e2516c4a8d60479b GIT binary patch literal 1494 zcmX|B3ou(*7`~ARAs(5gop`4$O4TDwi#|}fXy{PNwq070dW>bNWZOomM6~g!RgX1l zs#4pTYL#NQRND|?Rn;R@wOg!+N3~%kbR+S~-Rm)XXU@HI|MQ*y`~UBJ=VYJq_tDWZ z)B*rNhjIc8g1>}~p^1jyGnW@TmWSm=q4=pNR}j3JxZQ{6f?%*Rz+jA*tbN9O|NeJG8=Lma@?m*) zcuQ&*`OuoAVKy`}D#``)@)AqaG%Jp%86)5jXR#hP>%&XuW^V$goJYoLH_*uCQ9P%y}pfw(Ka--b&t<9?=u1THObIZC`DnSgr>R%52r?NiA59aTb7EL z94THsr1SH)yB7rrKKr9GpJ&v|2>Az6x zEVDCYCtk4_`_1y7KR>Dt+z3D%=$16|3+c&fO}B?)v$8aOt$&RBurld3W*OJ>g6Cd4 zHjVf608fx3Mb1ffdQ^I!Bw58p=x%Zx9jM2!9AHm{Yer*`t`qta?7aCi^GNM0nb>@l zo%I2{hO&0q#3OEJ0jty%z=%8jtjj+2ItHu~CYN+Boc8spsZpePgowO#TC-6}eZbMp zw88zbRUH7%KyAJgV4?N0dslsWDgIE-d#(6F&sSyP^TAq3-j@*I#ZB{S6GZ+^6350O zZ!&T*?Mk1mC~o9XN^YWV#7KFNq(b`E6JL@8?5fq zQm>(*gb;fk1S1u*pK8}X)`;r9&6e2DIXb?#TC9uQ(vp2vW;Dpo)H8KlTmL>&Sy$H| z82=|`wJYiRaGCK7w%(%hB z&cUIP{WpfnAYv#Ws_}DU@ylOFS3g6n*|fY@A4Z4$eK8{-s*s>+v)@uVU82GeKJP vOP8xMDm0h$FNGXS+sxNC?NYT-Agl-y*yD8lfnT4$|HePX%O8B^NoD^B3Y*MJ literal 0 HcmV?d00001 diff --git a/img/redo.png b/img/redo.png new file mode 100644 index 0000000000000000000000000000000000000000..ec8092451259fc3b86ae95957bdb1860b7ba51b5 GIT binary patch literal 3542 zcmV;{4Jq=8P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*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_IT.mo b/languages/wp-gpx-maps-it_IT.mo new file mode 100644 index 0000000000000000000000000000000000000000..b000d39dbc6f86a318a69883ca13b3f38a205965 GIT binary patch literal 857 zcmZvaO>fgc5QdjhzM_Iqx%RMEgtpkBLX``L*8LzNRinmKz$F^&!CB<&TI)@l_R4SI z&JW?n|LC0?y>jB+q?LulO0OQz&gh-djxSf2zX_ZUv<6ksL+A$-&Tr^GbOqgm{y>kR zrCW>pCt!%zz(=40gV!r?1v~)nfEoA|`Ur*m<N;M&y_jPK41Q0+;J*n5 zpC0%CJOW`g{|4r{WiZSd&Rqy4^Ijniv!jI&+m+XTTChl|V3UJW=h%2Tu#NWG8nJ87 zOl7GMdo%6j{OMb<;WK+B&Zen^G5QXIeHYvx)2sjxv=xrZ9@yg?A#mQQTG0OVy2KypeP_ zo<(sKp->(3sSd{ft$PtK>iX1pl{qp^Mcz8J=wr+&m8>$R3F5=v;a)pqydHH@YdqdW zW#={ed!G5{bw%22$$U(%VgLGFwy!qZx?umAo!T?GEwm{Ux%o-^&U-bmTxhS}^7)x{ zMbp=fPvmH{HR3k8Lk-vD$BA5TFK>oSWY1Hj$+W4|PK|fx$Yk675AFRB`^d)wIH?F; z>z$irYjeHs3ld??7kD$Q%gz^%<>lmbP9n3;kR(~?37hb)T3V+|ZO|V@V|EiOHD1P9 cu|ppJk(DXALQ`(>2UMpdPPnqU_CLRizgj`sD*ylh literal 0 HcmV?d00001 diff --git a/languages/wp-gpx-maps-it_IT.po b/languages/wp-gpx-maps-it_IT.po new file mode 100644 index 0000000..23775bf --- /dev/null +++ b/languages/wp-gpx-maps-it_IT.po @@ -0,0 +1,56 @@ +msgid "" +msgstr "" +"Project-Id-Version: wp-gpx-maps\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-06-21 14:24+0100\n" +"PO-Revision-Date: 2012-06-21 14:31+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-Language: Italian\n" +"X-Poedit-Country: ITALY\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../wp-gpx-maps.php:348 +msgid "Altitude" +msgstr "Altitudine" + +#: ../wp-gpx-maps.php:349 +msgid "Current Position" +msgstr "Posizione Corrente" + +#: ../wp-gpx-maps.php:350 +msgid "Speed" +msgstr "Velocità" + +#: ../wp-gpx-maps.php:351 +msgid "Heart rate" +msgstr "Battito Cardiaco" + +#: ../wp-gpx-maps.php:352 +msgid "Cadence" +msgstr "Cadenza" + +#: ../wp-gpx-maps.php:353 +msgid "Go Full Screen" +msgstr "Schermo intero" + +#: ../wp-gpx-maps.php:354 +msgid "Exit Full Screen" +msgstr "Torna a dimensioni originali" + +#: ../wp-gpx-maps.php:370 +msgid "Download" +msgstr "Scarica" + +#: ../wp-gpx-maps_admin_settings.php:67 +#: ../wp-gpx-maps_admin_settings.php:143 +#: ../wp-gpx-maps_admin_settings.php:245 +#: ../wp-gpx-maps_admin_settings.php:276 +msgid "Save Changes" +msgstr "Salva" + diff --git a/languages/wp-gpx-maps.pot b/languages/wp-gpx-maps.pot new file mode 100644 index 0000000..897fb4a --- /dev/null +++ b/languages/wp-gpx-maps.pot @@ -0,0 +1,54 @@ +msgid "" +msgstr "" +"Project-Id-Version: wp-gpx-maps\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-06-20 19:00+0100\n" +"PO-Revision-Date: 2012-06-20 19:00+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../wp-gpx-maps.php:348 +msgid "Altitude" +msgstr "" + +#: ../wp-gpx-maps.php:349 +msgid "Current Position" +msgstr "" + +#: ../wp-gpx-maps.php:350 +msgid "Speed" +msgstr "" + +#: ../wp-gpx-maps.php:351 +msgid "Heart rate" +msgstr "" + +#: ../wp-gpx-maps.php:352 +msgid "Cadence" +msgstr "" + +#: ../wp-gpx-maps.php:353 +msgid "Go Full Screen" +msgstr "" + +#: ../wp-gpx-maps.php:354 +msgid "Exit Full Screen" +msgstr "" + +#: ../wp-gpx-maps.php:370 +msgid "Download" +msgstr "" + +#: ../wp-gpx-maps_admin_settings.php:67 +#: ../wp-gpx-maps_admin_settings.php:143 +#: ../wp-gpx-maps_admin_settings.php:245 +#: ../wp-gpx-maps_admin_settings.php:276 +msgid "Save Changes" +msgstr "" + diff --git a/readme.txt b/readme.txt index 9b80f37..d8317f5 100644 --- a/readme.txt +++ b/readme.txt @@ -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.4 -Stable tag: 1.1.25 +Stable tag: 1.1.26 License: GPLv2 or later Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. @@ -13,7 +13,11 @@ Draws a gpx track with altitude graph. You can also display your nextgen gallery This plugin has, as input, the GPX file with the track you've made and as output it shows the map of the track and an interactive altitude graph (where available). -Fully configurable: custom colors and icons to make the map look like your site. +Fully configurable: + +- Custom colors +- Custom icons +- multiple language Support Display your NextGen Gallery images inside the map! Check nextgen gallery EXIF support.. @@ -101,6 +105,8 @@ The attributes are: 1. currentIcon: Current position icon (when mouse hover) +1. waypointicon: waypoint custom icon + 1. nggalleries: NextGen Gallery id or a list of Galleries id separated by a comma 1. ngimages: NextGen Image id or a list of Images id separated by a comma @@ -125,6 +131,10 @@ Yes! 1. Altitude & Speed & Hearth rate == Changelog == += 1.1.26 = +* Multilanguage implementation (only front-end). I've implemented the italian one, I hope somebody will help me with other languages.. +* Map Full screen mode (I'm sure it's not working in ie6. don't even ask!) +* Added waypoint custom icon = 1.1.25 = * Added possibility to download your gpx = 1.1.23 = diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php index 602db0a..379edf0 100644 --- a/wp-gpx-maps.php +++ b/wp-gpx-maps.php @@ -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.25 +Version: 1.1.26 Author: Bastianon Massimo Author URI: http://www.pedemontanadelgrappa.it/ License: GPL @@ -11,6 +11,8 @@ License: GPL //error_reporting (E_ALL); +load_plugin_textdomain('wp-gpx-maps', "/wp-content/plugins/wp-gpx-maps/languages/"); + include 'wp-gpx-maps_utils.php'; include 'wp-gpx-maps_admin.php'; @@ -49,7 +51,7 @@ function enqueue_WP_GPX_Maps_scripts() wp_enqueue_script( 'googleapis' ); wp_deregister_script( 'WP-GPX-Maps' ); - wp_register_script( 'WP-GPX-Maps', plugins_url('/WP-GPX-Maps.js', __FILE__), array('jquery'), "1.1.21"); + wp_register_script( 'WP-GPX-Maps', plugins_url('/WP-GPX-Maps.js', __FILE__), array('jquery'), "1.1.26"); wp_enqueue_script( 'WP-GPX-Maps' ); wp_deregister_script( 'highcharts' ); @@ -83,7 +85,7 @@ function findValue($attr, $attributeName, $optionName, $defaultValue) { $val = get_option($optionName); } - if ($val == '' && isset($_GET[$attributeName])) + if ($val == '' && isset($_GET[$attributeName]) && $attributeName != "download") { $val = $_GET[$attributeName]; } @@ -125,12 +127,15 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $startIcon = findValue($attr, "starticon", "wpgpxmaps_map_start_icon", ""); $endIcon = findValue($attr, "endicon", "wpgpxmaps_map_end_icon", ""); $currentIcon = findValue($attr, "currenticon", "wpgpxmaps_map_current_icon", ""); + $waypointIcon = findValue($attr, "waypointicon", "wpgpxmaps_map_waypoint_icon", ""); $ngGalleries = findValue($attr, "nggalleries", "wpgpxmaps_map_ngGalleries", ""); $ngImages = findValue($attr, "ngimages", "wpgpxmaps_map_ngImages", ""); $download = findValue($attr, "download", "wpgpxmaps_download", ""); $r = rand(1,5000000); + $gpxurl = $gpx; + $cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showW,$showHr,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$uom,v1.1.16"; $cacheFileName = md5($cacheFileName); @@ -173,7 +178,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $gpx = trim($gpx); - if (strpos($gpx, "http://") !== 0 || strpos($gpx, "https://") !== 0) + if (strpos($gpxurl, "http://") === 0 || strpos($gpxurl, "https://") === 0) { $gpx = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $gpx); $gpx = $sitePath . $gpx; @@ -341,22 +346,32 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') startIcon : "'.$startIcon.'", endIcon : "'.$endIcon.'", currentIcon : "'.$currentIcon.'", - zoomOnScrollWheel : "'.$zoomOnScrollWheel.'" + waypointIcon : "'.$waypointIcon.'", + zoomOnScrollWheel : "'.$zoomOnScrollWheel.'", + pluginUrl : "'.plugins_url().'", + langs : { altitude : "'.__("Altitude", "wp-gpx-maps").'", + currentPosition : "'.__("Current Position", "wp-gpx-maps").'", + speed : "'.__("Speed", "wp-gpx-maps").'", + heartRate : "'.__("Heart rate", "wp-gpx-maps").'", + cadence : "'.__("Cadence", "wp-gpx-maps").'", + gofullscreen : "'.__("Go Full Screen", "wp-gpx-maps").'", + exitfullscreen : "'.__("Exit Full Screen", "wp-gpx-maps").'" + } }); }); '; - - if ($download=='true' && $gpx != '') + + if ($download=='true' && $gpxurl != '') { - if (strpos($gpx, "http://") !== 0 || strpos($gpx, "https://") !== 0) + if (strpos($gpxurl, "http://") === 0 || strpos($gpxurl, "https://") === 0) { - + } else { - $gpx = get_bloginfo('url').$gpx; + $gpxurl = get_bloginfo('url').$gpxurl; } - $output.="Download"; + $output.="".__("Download", "wp-gpx-maps").""; } return $output; @@ -414,6 +429,7 @@ function WP_GPX_Maps_install() { add_option("wpgpxmaps_map_start_icon", '', '', 'yes'); add_option("wpgpxmaps_map_end_icon", '', '', 'yes'); add_option("wpgpxmaps_map_current_icon", '', '', 'yes'); + add_option("wpgpxmaps_map_waypoint_icon", '', '', 'yes'); add_option("wpgpxmaps_map_nggallery", '', '', 'yes'); add_option("wpgpxmaps_show_hr", '', '', 'yes'); add_option("wpgpxmaps_graph_line_color_hr", '#ff77bd', '', 'yes'); @@ -443,6 +459,7 @@ function WP_GPX_Maps_remove() { delete_option('wpgpxmaps_map_start_icon'); delete_option('wpgpxmaps_map_end_icon'); delete_option('wpgpxmaps_map_current_icon'); + delete_option('wpgpxmaps_map_waypoint_icon'); delete_option('wpgpxmaps_map_nggallery'); delete_option('wpgpxmaps_show_hr'); delete_option('wpgpxmaps_graph_line_color_hr'); diff --git a/wp-gpx-maps_admin.php b/wp-gpx-maps_admin.php index 197e3f2..b631479 100644 --- a/wp-gpx-maps_admin.php +++ b/wp-gpx-maps_admin.php @@ -111,6 +111,7 @@ function WP_GPX_Maps_html_page() {
  • chartFrom2: minimun value for speed chart
  • chartTo2: maxumin value for speed chart
  • startIcon: Start track icon
  • +
  • waypointicon: waypoint custom icon
  • endIcon: End track icon
  • currentIcon: Current position icon (when mouse hover)
  • nggalleries: NextGen Gallery id or a list of Galleries id separated by a comma
  • diff --git a/wp-gpx-maps_admin_settings.php b/wp-gpx-maps_admin_settings.php index e64d44a..b1d030b 100644 --- a/wp-gpx-maps_admin_settings.php +++ b/wp-gpx-maps_admin_settings.php @@ -64,7 +64,7 @@

    - + " />

    @@ -128,12 +128,19 @@ + + Custom Waypoint Icon: + + (Url to image) Leave empty for default + + +

    - - + + " />

    @@ -235,7 +242,7 @@

    - + " />

    @@ -266,7 +273,7 @@

    - + " />