Document how custom maps and layer switcher works

Created on 17 October 2016, about 8 years ago
Updated 11 June 2024, 5 months ago

The switcher is behaving oddly, see the attached video. I don't know why the switcher is visible anyway if I'm using a single layer, not a custom one.

📌 Task
Status

Fixed

Version

2.1

Component

Documentation

Created by

🇫🇮Finland merilainen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark ressa Copenhagen

    I can't get the switcher to work.

    I created a custom, following the method from the README file:

    Apart from using any of the "off-the-shelf" maps, you can also assemble your
    own map from the available layers at the Leaflet More Maps configuration page:
    admin/config/system/leaflet-more-maps. A layer switcher will automatically appear
    in the upper right-hand corner of the map.

    To reproduce:

    Create Custom map

    1. Open "Leaflet More Maps" (/admin/config/system/leaflet-more-maps)
    2. Create a "Custom map #1 layer selection", name: "CustMap"
    3. Check esri-world_topo_map and esri-world_street_map
    4. Save

    Add to a content type display

    1. Open "Manage display" (/admin/structure/types/manage/article/display)
    2. Open a Geofield field
    3. Set Format to "Leaflet map"
    4. Click on the settings icon to the right
    5. Open "Leaflet Map Tiles Layer" dropdown
    6. See that there is no "CustMap" ...

    Or am I doing it wrong, and need to set it somewhere else? In that case, perhaps the README instructions can be updated, and the correct steps included?

    Also, if I go to the "Leaflet Demo page" (/admin/config/system/leaflet-more-maps/demo), I see a lot of these errors. Maybe a clue? Uncaught DOMException: Document.querySelectorAll: '#~CustMap' is not a valid selector

  • 🇩🇰Denmark ressa Copenhagen

    After getting a reply from @berramou I tried again, and for some reason the Layer switcher is shown. Great!

  • Status changed to Needs review about 1 year ago
  • 🇩🇰Denmark ressa Copenhagen

    I updated the README with, after getting some great tips from @berramou.

    • berramou committed eb0999ca on 2.1.x
      Issue #2819431 by mErilainen: Document how custom maps and layer...
  • Status changed to Fixed 6 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024