Forum Replies Created

Viewing 15 replies - 16 through 30 (of 43 total)
  • Thread Starter timjh

    (@timjh)

    Simon – thanks for updating me. Coincidentally, I had just spent a bit of time this week implementing a marker index. Today’s task was to make it work with v1.3 :-(. You can see it in action on the page referenced in my original post.

    I had to hack os-datahub-maps.js to capture handles to (a) the map and (b) an array of marker layers (I wonder if there is a better way to get at these?).

    I used a do_shortcode_tag hook on [osmap] to append the name index below the map. In the index, each name is a link to the map (to make it scroll into view) and holds a data attribute for the array index of the relevant marker layer.

    My JS script, responding to a click on a name, takes just a few lines to retrieve the marker index, fly to the marker and pop it open.

    I don’t like the long list of names in a single column, but a bit of CSS will fix that shortly.

    Thread Starter timjh

    (@timjh)

    Thanks for your quick response. I have done as you suggest and created a feature request.

    Meanwhile, an opportunity to brush up my SQL beckons…

    Thread Starter timjh

    (@timjh)

    Great! Thanks.

    Thread Starter timjh

    (@timjh)

    Thanks very much for finding that reference, and yes, I think your suggested approach would work for me. The order of the list would be important – presumably it would be simple to preserve the order in which the markers are defined in the markerfile or markers list.

    Thinking about a bit more generalisation: Obviously each list item should default to showing the marker label, but it might be nice to be able to modify it for display – perhaps via a hook? (Probably better than adding a “list-item-label” field to the already complex marker definition.) It might also be nice to have a hook for manipulating the list, eg to drop items or re-order, or insert additional HTML for grouping purposes.

    Someone may want to embed a marker link in text on the same page: they could do this by enabling the list option, copying and pasting the link from the list and then disabling the list, or suppressing it in the CSS. I would actually find it useful to embed a marker link in text on a different page; I suppose that would need some URL query parameters; perhaps a step too far :-).

    The code in the reference you found looks fairly straightforward, although I’m not sure how to make it work alongside the plugin. Have I piqued your interest enough for you to add it to your to-do list? I’d willingly run tests!

    • This reply was modified 4 years, 8 months ago by timjh.
    • This reply was modified 4 years, 8 months ago by timjh.
    • This reply was modified 4 years, 8 months ago by timjh.

    @stevejburge
    Thanks for attending to this, but it doesn’t solve it for me. However my testing shows that (for me) the problem is dependent on whether Auto-enable is set or not for the Post Type in Post Expirator settings. If disabled, all works as expected – when editing the post I can check “Enable Post Expiration” on or off and it sticks. But when Auto-enable is set to “Enabled”, the Enable Post Expiration box comes back checked at every update. This is so on both the current live version 2.6.0 and the beta version of the plugin.

    I’m getting exactly the same problem.

    Thread Starter timjh

    (@timjh)

    Looks good! Many thanks.

    Thread Starter timjh

    (@timjh)

    Understood. Thanks for swift response. You’ve been busy over the Bank Holiday!

    Yes, the tracks show up as two separate <path> elements. I take your point about fixing the gpx for preference, but you could change the colour of the shortcut path from blue to (say) green with

    path.leaflet-interactive:nth-child(2) {
      filter: hue-rotate(270deg);
    }

    I did try a CSS selector of path.leaflet-interactive[d^="M318"], since it is only the d attribute, defining the actual track, that distinguishes the paths; but its value changes when you zoom in :-(.

    I have no experience with multiple tracks, but if they are represented on the webpage by separate HTML elements, then there is always a way to target them individually, for example with :nth-child() or some unique attribute value. Can you share an example page?

    If you can target the right track with CSS, you could apply a filter effect to the <path> element. https://developer.mozilla.org/en-US/docs/Web/CSS/filter

    Thread Starter timjh

    (@timjh)

    Thank you! I’ve made it stand out a bit more with CSS:

    
    .os-datahub-map .leaflet-control-scale-line {
      background-color: rgba(255, 255, 255, 0.8);
      font-size: larger;
      font-weight: bold;
    }
    
    • This reply was modified 5 years, 7 months ago by timjh.

    Uh-oh. After a bit more testing, I realised that there is a problem with setting this string in the WordPress Classic editor. It all falls apart in “Visual” mode. At least in my test environment, the shortcode needs to be entered in “Text” mode, and kept that way – switching to “Visual” will clobber it by changing single quotes to double quotes and who knows what else.

    It’s possible that your example has been mangled when displayed in this forum, but I found several problems. There are some strange quotes that are not standard ASCII double or single quotes, there are some newlines and there are no closing </a> tags.

    After a bit of editing I found that this string works:
    [osmap zoom="3" width="900" markers="TL81063051;<a href='http://trailmanco.wwwnl1-lr5.supercp.com/england/east/essex-extras/halstead/' rel='nofollow ugc'>Halstead</a>|TL897189;<a href='http://trailmanco.wwwnl1-lr5.supercp.com/england/east/essex-extras/messing-and-layer-marney/' rel='nofollow ugc'>Messing and Layer Marney</a>|TQ925930;<a href='http://trailmanco.wwwnl1-lr5.supercp.com/england/east/essex-extras/paglesham/' rel='nofollow ugc'>Paglesham</a>|TL514248;<a href='http://trailmanco.wwwnl1-lr5.supercp.com/england/east/essex-extras/stansted-mountfichet/' rel='nofollow ugc'>Stansted Mountfichet</a>|TL679410;<a href='http://trailmanco.wwwnl1-lr5.supercp.com/england/east/essex-extras/steeple-bumpstead/' rel='nofollow ugc'>Steeple Bumpstead</a>"]

    Some of the links go to “HTTP Referrer not valid”, which I assume is deliberate, but the Hadleigh Halstead one works!

    For this forum, it’s best to enclose example code in <code>...</code> tags.

    • This reply was modified 5 years, 7 months ago by timjh.
    • This reply was modified 5 years, 7 months ago by timjh.
    • This reply was modified 5 years, 7 months ago by timjh.
Viewing 15 replies - 16 through 30 (of 43 total)