-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple heatmaps #96
Comments
It is possible. e.g. look at the heatmap.js homepage: http://www.patrick-wied.at/static/heatmapjs/ |
Do all elements that the heatmap applies to need to have a seperate ID? Because I'm creating a heatmap for elements that all have the same class. |
Never mind figured out, had a scope issue. Thanks for replying 👍 |
Hei, Is it possible to have multiple heatmapjs layers in the same leaflet map with different styles? |
@pa7 is your answer still correct? Im finding that with the leaflet plugin even just creating a second HeatmapOverlay instance the first one (which is shown properly) just disappears: ` var cfg = {
` |
I have the same problem @dgorissen The library is awesome but I miss that functionality @pa7 |
@dgorissen that's interesting. have you tried creating an overlay, then adding it, then creating the second overlay and adding it? |
@pa7 thanks for the response. Interestingly using a separate config object indeed prevents the first heatmap from breaking and it seems to show normally. I can never get the second one to show though, regardless of the order I create / add them. As soon as the second one is created it breaks the first. I would hope its a small referencing related fix, it really would be useful to be able to have multiple heatmaps on the same map instance. |
@pa7 any pointers on how to potentially fix/hack around this? |
@pa7 , @dgorissen , @mmontes11, @Robinfr ,
Here it is how it looks Here it is how the code should look like function drawHeatmaps(){
} function getGradient (number){ If you have questions please let me know and good luck! |
@dgorissen @pa7 do you solve this problem? I cant add two heatmap on one map.
now, i try add both heatmaps on leaflet map:
In web console i see, that map-object have two layer with different data and cfg, but i have seen only first layer. Do you have any solution? |
problem was in styles. In my DOM-tree i find correct layer, than been under map div. |
@zhukovRoman <div style="position: relative; height: 600px; width: 800px; display: absolute !important;" class="heatmap" id="map-canvas">
</div> but the second layer is not showing up. |
@ssilwa and I simply add style and all works fine for me. |
@zhukovRoman Sorry, can you be clearer? I am not sure where I should add that style. |
@ssilwa add it somewhere after the leaflet stylesheet so it will override the leaflet style. |
@pa7 @zhukovRoman
after the leaflet style sheet but only the first layer is showing. Here is my code for the layers:
Is it an issue there ? |
@ssilwa
Now, in any place inside BODY tag place map container:
and use heatmap as you described above. If problem will still, please, provide some jsfiddle example with minimal working code. |
@pa7 @zhukovRoman Ok, it seems to work! Thank you again! Btw, I think an example of this should be added to the examples page sometime in the future! It is a really cool functionality! |
@ssilwa thank you for the feedback, I will add an example with multiple layers soon :) |
Any update on this issue @pa7 |
Any update? |
It doesn't seem to be possible to have multiple heatmaps on one page?
The text was updated successfully, but these errors were encountered: