Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter joze

    (@joze)

    @bozdoz

    thanks again. Here’s what I get:

    1. spreading marker or geojson content across several lines doesn’t work any more. This doesn’t work (it worked at least for markers but not for geojson before):

    [leaflet-marker]
    blabla
    <a href="/fred.html">
    [/leaflet-marker]

    2. what works for both markers and geojson is if I have everything in one line like this:

    [leaflet-marker]blabla<a href="/fred.html">[/leaflet-marker]

    3. having div’s does not only introduce paragraphs (I don’t understand why, but anyway) but additionally it introduces newlines, so if the content between the shortcodes has div’s like this:

    [leaflet-marker]<div>blabla<a href="/fred.html"><div>[/leaflet-marker]

    the resulting js has newlines within the string, which gives errors (note the line breaks):

    marker.bindPopup(WPLeafletMapPlugin.unescape('</p>
    <div>blabla<a href=&quot;/fred.html&quot;></p>
    <div>'));

    To summarize:

    I changed my code to not use div’s any more and therefore it works ??

    • This reply was modified 7 years, 3 months ago by joze.
    • This reply was modified 7 years, 3 months ago by joze.
    Thread Starter joze

    (@joze)

    hmm. markers are there again, though I didn’t change anything. Maybe a cache problem. Sorry for bandwidth.

    There’s another problem though.

    [leaflet-geojson src="/tmp.geojson"]fred[/leaflet-geojson]

    translates into

    popup_text = 'fred'

    which is ok.

    BUT:

    [leaflet-geojson src="/tmp.geojson"]<div>fred</div>[/leaflet-geojson]

    translates into

    popup_text = ‘
    <div>fred</div>
    <p>’

    Note that some newlines appeared in the text which is NOT ok and generates an error "Uncaught SyntaxError: Invalid or unexpected token"

    If I use any html which is more complex than simple text, it is translated somehow to multiline text which generates errors.

    Any ideas?

    • This reply was modified 7 years, 3 months ago by joze.
    • This reply was modified 7 years, 3 months ago by joze.
    • This reply was modified 7 years, 3 months ago by joze.
    • This reply was modified 7 years, 3 months ago by joze.
    Thread Starter joze

    (@joze)

    wow, thanks for the rapid implementation!

    But: something seems to be broken now. I just updated to 2.8.0 and no markers are shown at all now. Also the “shortcode helper” page seems to be broken and doesn’t show markers any more.

    js errors shown:

    Uncaught TypeError: WPLeafletMapPlugin.getCurrentMarkerGroup is not a function
        at admin.php?page=leaflet-get-shortcode:274
        at init (construct-leaflet-map.js?ver=1.0:9)

    or

    Uncaught TypeError: WPLeafletMapPlugin.getCurrentMarkerGroup is not a function
        at (index):224
        at init (construct-leaflet-map.js?ver=1.0:9)
Viewing 3 replies - 1 through 3 (of 3 total)