• Resolved kjell87

    (@kjell87)


    Hi all,

    First, thanks for a great plugin. It is easy to use and very helpfull.

    When updating from version 3.0.5 to 3.1.0, the map disappears (grey background). I have been using the “Map Tile URL” field on the settings page. This worked in version 3.0.5. For info, yes I use newest leaflets 1.9.3.
    I have been using the plugin for approx.. two years.

    I’ve been troubleshooting and found out why and this is related to base64 encoding. Here are the URL I use: https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4\u0026zoom={z}\u0026x={x}\u0026y={y} (Norwegian free map)

    I think certain special characters cannot be converted/encoded, because the line into class.map-shortcode.php

    1. Version 3.0.5
      In folder: leaflet-map\shortcodes and file class.map-shortcode.php, Line 317
    2. Version 3.1.0
      In folder: leaflet-map\shortcodes and file class.map-shortcode.php, Line 299

    After updating, and before I do any modification, I only had a grey map with only showing the gpx track.

    I editing class.map-shortcode.php on line 299 (version 3.1.0) to be like line 317 (version 3.0.5) and then all works becuase of the none encoding.

    I fully understand why you added base64 encoding, and I have done this “modification” on a password protected test-site, but is it a bug that it fails to convert the link; https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4\u0026zoom={z}\u0026x={x}\u0026y={y} or should the URL now be written different becuase of the encoding now in 3.1.0 version? Because of some special characters?

    If you want to se the map in use, please go to https://fjell-vandring.net/ and scroll down (Norwegian hiking site).

    Please note! On this site (fjell-vandring.net), I am still using the version 3.0.5 and old leaflets package. I have only updated and modified the file class.map-shortcode.php on a password protected test-site.

    Thank you in advance for your help

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor hupe13

    (@hupe13)

    Why you write “\u0026” and not “&”?

    Thread Starter kjell87

    (@kjell87)

    Hi,

    Good question, and I am actually not sure (sorry), what does the text back “topo4” means?

    But I have now tried following combinations:

    Version 3.0.5 – All works!
    https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4\u0026zoom={z}\u0026x={x}\u0026y={y}

    https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}

    https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4\&zoom={z}\&x={x}\&y={y}

    Version 3.1.0 – None of them works!
    https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4\u0026zoom={z}\u0026x={x}\u0026y={y}

    https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}

    https://opencache.statkart.no\/gatekeeper\/gk\/gk.open_gmaps?layers=topo4\&zoom={z}\&x={x}\&y={y}

    Plugin Contributor hupe13

    (@hupe13)

    If I set tileurlin Leaflet Map settings, it works:

    https://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}

    If I write it in post, it works.

    [leaflet-map address="Oslo" tileurl="https://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}"]

    But the editor writes it false (when I reopen to edit) and it does not work.

    [leaflet-map address="Oslo" tileurl="https://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}"]

    There is no error in base64 encoding and decoding.

    Thread Starter kjell87

    (@kjell87)

    Hi,

    Thanks for your quick reply.
    I tested with your first line now, and it works! Amazing, thanks a lot!

    https://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}

    The problem was definitely the URL, but it might be a combination of “\/”(slash) and “/u0026x”

    Anyway, thanks a lot! 🙂
    No i will put the Leaflet extension map as “Activated” and add elevation and fullscreen to the map.

    • This reply was modified 3 years, 4 months ago by kjell87.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Map Tile URL – Issue with base64 encoding’ is closed to new replies.