{ Dev Farm }

Web & Windows Development

[How-To] Use wp-gpx-maps on a non-wordpress website

Home Forum Wp Gpx Maps Stand-alone [How-To] Use wp-gpx-maps on a non-wordpress website

Questo argomento contiene 8 risposte, ha 2 partecipanti, ed è stato aggiornato da  max 1 anno fa.

Stai vedendo 9 articoli - dal 1 a 9 (di 9 totali)
  • Autore
  • #3059 Risposta

    Amministratore del forum

    The sample below show how to use wp-gpx-maps wordpress plugin outside wordpress.

    – Get latest plugin version: http://wordpress.org/extend/plugins/wp-gpx-maps/
    – unzip and place the plugin files
    – set the variables $uploadDir, $uploadUrl, $pluginDir, $gpxUrl
    – done!

    If you want a better code optimization you can directly edit the plugin files!

    N.B. Obviously NextGEN Gallery integration in not working and it throws exceptions!

    demo: https://devfarm.it/samples/wp-gpx-maps-stand-alone.php

    download source: https://devfarm.it/samples/wp-gpx-maps-stand-alone.php.txt

    $sitePath = "../"; // or realpath('.');
    $uploadDir = $sitePath . "wp-content/uploads"; // Must be writable. The plugin will create the /gpx and /gpx/~cache subfolders
    $pluginDir = $sitePath . "wp-content/plugins/wp-gpx-maps/"; // wordpress plugin path
    $uploadUrl = "/wp-content/uploads/gpx/"; // gpx download path
    $gpxUrl = $uploadUrl . "Mountainbike.gpx"; // your gpx file
    /* wordpress function wrapper */
    function load_plugin_textdomain(){}
    function is_admin() {return false;}
    function add_action(){}
    function add_shortcode(){}
    function register_activation_hook(){}
    function register_deactivation_hook(){}
    function add_filter(){}
    function get_option(){return "";}
    function wp_upload_dir(){return Array ( "basedir" => $uploadDir ); }
    function plugins_url(){return $uploadUrl ;}
    function __($val){return $val;}
    include $pluginDir.'wp-gpx-maps.php';
    <!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>WP GPX Maps - standalone</title>
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="https://maps.googleapis.com/maps/api/js?sensor=false&v=3.9" type="text/javascript" ></script>
    <script src="http://code.highcharts.com/highcharts.js" type="text/javascript" ></script>
    <script src="<?php echo $pluginDir; ?>WP-GPX-Maps.js" type="text/javascript" ></script>
    <style type="text/css" media="screen">
    echo print_WP_GPX_Maps_styles();
    plugin call with all the possible settings
    more info here: http://wordpress.org/extend/plugins/wp-gpx-maps/faq/
    echo handle_WP_GPX_Maps_Shortcodes( Array (
    "gpx"=> $gpxUrl,
    "width"=> "100%",
    "mheight"=> "450px",
    "gheight"=> "200px",
    "showhr"=> false,
    "waypoints"=> false,
    "showspeed"=> true,
    "showgrade"=> true,
    "zoomonscrollwheel"=> false,
    "donotreducegpx"=> false,
    "pointsoffset"=> 10,
    "chartto2"=> "",
    "starticon"=> "",
    "endicon"=> "",
    "currenticon"=> "",
    "waypointicon"=> "",
    "nggalleries"=> "",
    "download"=> "",
    "dtoffset"=> 0,
    "skipcache"=> "",
    "summary"=> "",
    "summarytotlen"=> true,
    "summarymaxele"=> true,
    "summaryminele"=> true,
    "summaryeledown"=> true,
    "summaryavgspeed"=> true,
    ) );
    • Questo argomento è stato modificato 1 anno fa da  max.
    • Questo argomento è stato modificato 1 anno fa da  max.

    #21620 Risposta



    I’m interested using the plugin outside WP. I copied the code above and replaced the directories but the page is empty, even the scripts are not loaded. Could you please explain how to use the files without a CMS, just for a single GPX file in a bit more detail?


    #21655 Risposta

    Amministratore del forum

    Hi, this is a working sample, just unzip the folder and everything should work

    #23525 Risposta

    Dener Fernandes


    This code non-wordpress was exactly what I was looking for, just unable to display the Heart rate, values ​​comes zeroed, on wordpress is shown, but the plug-in non-wordpress not. What can it be?

    My GPX: http://www.personalon.com.br/activity_398049934.gpx

    On wordpress: http://personalon.com.br/blog/nutricao/teste/

    Could you please help me?



    #23527 Risposta

    Amministratore del forum

    You should set the variable

    echo handle_WP_GPX_Maps_Shortcodes( Array (
    “gpx”=> $gpxUrl,
    “width”=> “100%”,
    “mheight”=> “450px”,
    “gheight”=> “200px”,
    “showhr”=> true,
    “waypoints”=> false,

    #24710 Risposta


    Hi Max!

    Thank you very much! That’s exactly what I need for my website. But since I a couple of comments.

    How do I get a message for updates?

    I use the pages so created as an iFrame into my website. It would be nice if the full screen function would work out of the iframe out. So they will only work within the iframes.

    When activating the scroll-zoom must be “true” to be quoted.

    The text of the numbers of elevations in Altidue graphics are unfortunately obscured. Can this be fixed?

    #24711 Risposta


    Ok, i have find it yourself.
    in the javascript file ->
    var yaxe = {
    title: { text: null },
    labels: {
    align: ‘left’,
    x: 0,
    // END EDIT
    formatter: function() {
    return Highcharts.numberFormat(this.value, l_y.dec,decPoint,thousandsSep) + l_y.suf;

    Another Question: Is it possible to operate the plugin complete without Google? Or is Google an integral part?

    #28830 Risposta


    My website is on weebly and would love to us your plug-in but I am not great with code…can you help??

    #75779 Risposta

    Amministratore del forum

    I just updated the sample with a fiew changes.
    If you have a (few) programming skills you can follow the sample above..

Stai vedendo 9 articoli - dal 1 a 9 (di 9 totali)
Rispondi a: [How-To] Use wp-gpx-maps on a non-wordpress website

You can use BBCodes to format your content.
Your account can't use Advanced BBCodes, they will be stripped before saving.

Le tue informazioni:

:bye:  :good:  :negative:  :scratch:  :wacko:  :yahoo:  B-) 

Non è possibile lasciare nuovi commenti.