• maaikez

    (@maaikez)


    Hi,

    I found your leaflet extensions plugin on wordpress and I am really pleased by it. I have a blog with some tours I did on ski, kayak and walking and I like the clickable markers and maps with elevation etc.

    My question is: would it be possible to change overviewmap in such a way that it does not (only) show a marker for a specific page, but a gpx file? So you have an overviewmap with gpx files you can click on to go to the specific blog of that tour.

    Kind regards,

    Maaike

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

    (@hupe13)

    overviewmap collects the marker from the custom fields defined in pages or posts only. But you can define your markers in a gpx (or geojson) file and load it in the map:

    [leaflet-map fitbounds]
    [overviewmap latlngs=...]
    [leaflet-geojson src="https://your-domain.tld/path/to/points.geojson"]{your_link}[/leaflet-geojson]
    [hover class=leafext-overview-tooltip]

    The geojson file example:

    {
    "type": "FeatureCollection",
    "features": [
    {
    "type": "Feature",
    "properties": {
    "your_link": "<a href=https://bla.com/path/point1/>Interesting point1</a>"
    },
    "geometry": {
    "coordinates": [
    12.34,
    5.67
    ],
    "type": "Point"
    },
    "id": 0
    },

    gpx is similar.

    Thread Starter maaikez

    (@maaikez)

    Thanks, did not try that yet, only the elevation. But this is nice.

    It would just be a nice feature to have it, or should I add feature requests in github?

    Plugin Author hupe13

    (@hupe13)

    No, leaflet-geojson is from Leaflet Map. More documentation is here. Do you know my doumentation? I know it’s a lot and not always easy. Just ask!

    Thread Starter maaikez

    (@maaikez)

    But overviewmap is yours, isn’t it?
    And your documentation is good enough! The examples really help.

    Thread Starter maaikez

    (@maaikez)

    Unfortunately, this does not work. It only shows {your_link}. (literal)

    What I want is (I hope it is possible):

    A map with multiple tracks like with multi elevation. But then all tracks (or eventually waypoint somewhere at the start of the track) clickable (or via popup) to go the the corresponding blog post.

    Tried this:

    [leaflet-map fitbounds]
    [leaflet-gpx src="<url-to-gpx>"]{url}[/leaflet-gpx]
    [hover]
    [layerswitch]
    [fullscreen]

    And gpx looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <gpx version="1.0" creator="GPSBabel - https://www.gpsbabel.org" xmlns="http://www.topografix.com/GPX/1/0">
    <time>2025-03-16T16:28:00.432Z</time>
    <bounds minlat="61.179995723" minlon="8.077578228" maxlat="61.245863065" maxlon="8.129223576"/>
    <wpt lat="61.180004356" lon="8.09308433">
    <name>Some text</name>
    <ele>951.600</ele>
    <url>https://thisistheurl.gpx</url>
    <urlname>Some url name</urlname>
    </wpt>
    <trk>
    <trkseg>
    <trkpt lat="61.180004356" lon="8.093084330">
    <ele>951.600</ele>
    <time>2025-03-12T12:24:06Z</time>
    <speed>0.000000</speed>
    </trkpt>
    ...
    </trkseg>
    </trk>
    </gpx>

    Is there a way to do this clickable markers with multi elevation?

    Plugin Author hupe13

    (@hupe13)

    Unfortunately the tags <url> and <urlname> are not supported for gpx from the togeojson library. But you can convert the gpx to geojson with GPSBabel. Open the resulting gejson file with a text editor. Search the string “properties”. You can see the properties from starting point. But the properties from track are empty. Add some information, for example:

                    "type": "LineString"
    },
    "properties": {
    "description": "Start day 1: Track Kyrkjestolen",
    "name": "Start day 1: Track Kyrkjestolen",
    "url": "https://my-domain.tld/path/to-blog/",
    "urlname": "Show blog"
    },
    "type": "Feature"

    and use the shortcode

    [leaflet-map fitbounds]
    [leaflet-geojson src="https://my-domain.tld/wp-content/uploads/file_test2.geojson"]<a href="{url}">{urlname}</a>[/leaflet-geojson]
    [hover]
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.