Unchanged order of multiple markers of a location after filtering

Created on 16 May 2025, 22 days ago

I use the module with Leaflet and have locations that have categories (taxonomy terms). Each location can have multiple categories. The locations are displayed via a view. There, I can filter these locations based on the categories. Multiple selections are allowed. Each category has its own image, displayed as a marker in a specific color.

For locations with multiple categories, the different markers of the same location are overlaid. If I activate a views filter, the filtering is correct and the correct markers are displayed. However, for matching locations with multiple categories, the z-index of the marker of the selected category is not incremented, so a marker of a different category is still displayed. How can I change the z-index?

πŸ› Bug report
Status

Active

Version

3.14

Component

Geolocation Field / Backend

Created by

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

Comments & Activities

  • Issue created by @dansab
  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany

    Eh, what now? Z-Index of what? Icon? Marker? I honestly don't know. What specifically needs the z-index?

  • If a location has two categories, two markers are displayed one above the other in the map within a view. The z-index shows that the values ​​are the same.

    <div class="leaflet-pane leaflet-marker-pane">
        <img
            src="/sites/default/files/2025-03/opfer.png"
            class="leaflet-marker-icon leaflet-zoom-animated leaflet-interactive"
            title="Playground-Spur" alt="Marker" tabindex="0" role="button"
            style="transform: translate3d(648px, 266px, 0px); z-index: 266;">
        <img
            src="/sites/default/files/2025-03/taeter.png"
            class="leaflet-marker-icon leaflet-zoom-animated leaflet-interactive"
            title="Playground-Spur" alt="Marker" tabindex="0" role="button"
            style="transform: translate3d(648px, 266px, 0px); z-index: 266;">
    </div>
    

    If I want to display only certain categories using a view's filter, the z-index doesn't change for those locations. The correct locations are displayed, but the image doesn't match the selected category. The affected category would either need to be given a larger z-index or the non-matching markers would need to be hidden.

  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany

    Shouldn't the latter happen anyway?
    I mean, if you ignore geolocation and just imagine a regular list view; shouldn't the filter only show relevant entries?

  • Currently, I only have one post, so please don't be surprised. When I change the view to an unformatted list, the post loads twice, see screenshot. When I click the appropriate category in the filter, the post still appears twice. I also enabled Reduce Duplicates, but that didn't change anything. Is the problem with the view?

  • Currently, I only have one post, so please don't be surprised. When I change the view to an unformatted list, the post loads twice, see screenshot. When I click the appropriate category in the filter, the post still appears twice. I also enabled Reduce Duplicates, but that didn't change anything. Is the problem with the view?

  • I've attached two images. Strangely, they can't be included in the reply - the post isn't saved. Currently, I only have one post, so don't be surprised. If I change the view to an unformatted list, the post loads twice, see screenshot. If I click the appropriate category in the filter, the post still appears twice. I also enabled Reduce Duplicates, but that didn't change anything. Is the problem with the view?

  • I've attached two images. Strangely, they can't be included in the reply - the post isn't saved. Currently, I only have one post, so don't be surprised. If I change the view to an unformatted list, the post loads twice, see screenshot. If I click the appropriate category in the filter, the post still appears twice. I also enabled Reduce Duplicates, but that didn't change anything. Is the problem with the view?

  • I've attached two images. Strangely, they can't be included in the reply - the post isn't saved. Currently, I only have one post, so don't be surprised. If I change the view to an unformatted list, the post loads twice, see screenshot. If I click the appropriate category in the filter, the post still appears twice. I also enabled Reduce Duplicates, but that didn't change anything. Is the problem with the view?

  • I've attached two images. Strangely, they can't be included in the reply - the post isn't saved. Currently, I only have one post, so don't be surprised. If I change the view to an unformatted list, the post loads twice, see screenshot. If I click the appropriate category in the filter, the post still appears twice. I also enabled Reduce Duplicates, but that didn't change anything. Is the problem with the view?

  • I found the cause. The "Reduce Duplicates" option was enabled in the filter. After disabling it, everything worked as expected. I'm sorry for my clumsiness, and thank you for your quick support.

  • πŸ‡©πŸ‡ͺGermany christianadamski Berlin, Germany

    Don't worry, you're absolutely welcome :)

Production build 0.71.5 2024