Sorry, I try to repair the formatting a bit:
Hello,
On my website I offer the download link to the gpx file to my readers.
Unfortunately, my browser (firefox) tried to open the gpx-file as xml without styling.
I found out, that adding the attribute “download” to the link does the trick and forces the browser to download the file instead of trying to display it. See http://www.w3schools.com/tags/att_a_download.asp for details.
So I went to wp-gpx.maps.php in the plugin directory and edited line 731 from
$output.="<a href='$gpxurl' target='_new' >".__("Download", "wp-gpx-maps")."</a>";
to
$output.="<a href='$gpxurl' target='_new' download>".__("Download", "wp-gpx-maps")."</a>";
An other problem is to upload gpx-files to wordpress via media-uploader. I needed to add the following lines to my functions.php to allow uploads of gpx-files:
add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes=array() ) {
$existing_mimes['gpx'] = 'application/gpx+xml';
return $existing_mimes;
}
Maybe both solutions could be part of the next version of this wonderful plugin? Thanks for your work!
Greetings Konrad :good: