Skip to content

HeatmapWithTime is visualized in the back of overlay image #1400

Open

Description

@JavierParada

HeatMapWithTime is visualized in the back of the overlay image, even after including <style>.leaflet-heatmap-layer{z-index:300 !important}</style> in my html.

According to #1201, including this <style>.leaflet-heatmap-layer{z-index:300 !important}</style> in my html should bring the Heatmap to the front. However, that did not work.

My map looks like this:

Basemap

m = folium.Map([35, 41], tiles='stamentoner', zoom_start=6)

Land Use Changes

folium.raster_layers.ImageOverlay(
image=dataimage,
bounds=[[ymin, xmin], [ymax, xmax]],
colormap = lambda x: (x, x, x),
name= 'MODIS Transitions 2009 vs. 2017',
opacity=.8,
zindex=1,
overlay=False,
mercator_project=True).add_to(m)

UCDP HeatMap

hm = HeatMapWithTime(data=list(data.values()), # coordinates
index=list(data.keys()), # years
name = 'UCDP events',
radius=10,
auto_play=False,
max_opacity=1).add_to(m)

folium.LayerControl().add_to(m)
m.save('html/index.html')

My html header is attached:
index.txt

Activity

  1. changed the title [-]HeatmapWithTime is visulized in the back of overlay image[/-] [+]HeatmapWithTime is visaulized in the back of overlay image[/+] on Oct 20, 2020
  2. changed the title [-]HeatmapWithTime is visaulized in the back of overlay image[/-] [+]HeatmapWithTime is visualized in the back of overlay image[/+] on Oct 20, 2020
  3. JavierParada commented on Oct 20, 2020

    @JavierParada
    Author

    Screen Shot 2020-10-20 at 1 19 46 PM

    The HeatMap is shown behind the image.

  4. added
    bugAn issue describing unexpected or malicious behaviour
    on Nov 22, 2022
  5. Dakcser commented on Apr 3, 2023

    @Dakcser

    I quess better late then never. If anybody else has problem with HeatMapWithTime drawing data behind ImageOverlay. Instead of using above mentioned line of HTML code which tries to push heatmap layer foward.

    You can instead push ImageOverlay back with code <style>.leaflet-image-layer{z-index:-1 !important}</style> (Index -1 sets image back of the stack).

    Sieppaa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue describing unexpected or malicious behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions