• Resolved joergenlang

    (@joergenlang)


    Quick question: Is there any (simple) way to add the “nauticscale” plugin to the installation? I’m working on a site for friends who do sailing trips.

    I’m happy to contribute a plugin if I could find a good and not too complicated starting point. I’m aware of “Extensions for Leaflet Map”.

    Any pointers and ideas are welcome!

    J. Lang

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author hupe13

    (@hupe13)

    Bozdoz has a FAQ:
    How Can I Add another Leaflet Plugin?
    I use this for every Leaflet plugin I have included.

    Maybe, you can extend leaflet-scale.

    Thread Starter joergenlang

    (@joergenlang)

    Thanks a truckload!
    I’ll try that.

    J. Lang

    Plugin Author hupe13

    (@hupe13)

    I tried it out today. However, I have a shortcode [php] ... [/php] to run php.

    <!-- wp:shortcode -->
    [php]
    wp_enqueue_script('nauticscale', &quot;https://mydomain.tld/path/to/js/leaflet.nauticscale.js&quot;, array('wp_leaflet_map'), null);
    [/php]
    <!-- /wp:shortcode -->
    
    <!-- wp:shortcode -->
    [leaflet-map]
    [leaflet-scale]
    <!-- /wp:shortcode -->
    
    <!-- wp:html -->
    <script>
    window.WPLeafletMapPlugin = window.WPLeafletMapPlugin || [];
    window.WPLeafletMapPlugin.push(function () {
    var map = window.WPLeafletMapPlugin.getCurrentMap();
    map.addControl(new L.Control.ScaleNautic({
    metric: false,
    imperial: false,
    nautic: true
    }));
    });
    </script>
    <!-- /wp:html -->
    • This reply was modified 1 year, 11 months ago by hupe13.
    • This reply was modified 1 year, 11 months ago by hupe13.
    Plugin Author hupe13

    (@hupe13)

    Replace &quot; with ".

    Thread Starter joergenlang

    (@joergenlang)

    Awesome and thanks again!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding more Plugins HOWTO’ is closed to new replies.