Skip to content
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

Can a heatmap represent the value of a property across a map rather than points density? #7218

Closed
chseluv opened this issue Aug 29, 2018 · 6 comments

Comments

@chseluv
Copy link

chseluv commented Aug 29, 2018

I have a map where I will be placing a lot of user-submitted markers. Each marker, a GeoJSON point, will represent an item that has a set of feature properties. I don't need to show how many markers appear close to each other, that is irrelevant to my plot. I'd rather show the user where specific values for that property reside with higher frequency on the map.

Is this something a heatmap could do in Mapbox-GL JS?

I was considering tying the heatmap-color to some property expression. Does anyone know if or how this is achievable?

@mourner
Copy link
Member

mourner commented Aug 29, 2018

You can try creating multiple heatmap layers, each for the specific value range that you want to show density for. Otherwise I don't have any tips to offer — the heatmap layer is specifically designed to show point density.

@mourner mourner closed this as completed Aug 29, 2018
@tempranova
Copy link

Is there any way to open this up again? I think there is a good use-case to have heatmaps coloured in ways other than only by density.

For an example: my client wants to show a heatmap of the shots gained per shot on a golf course. He wants a heatmap that shows shots not by their density, but a mix according to the shots gained property. I can't currently implement a custom color scheme by a property on the data on the heatmap: the only way to do it is by density.

For example, see this request about QGIS: https://gis.stackexchange.com/questions/192158/styling-a-heat-map-based-on-point-attribute-not-density

Any chance of getting this implemented?

@ryanbaumann
Copy link
Contributor

You can use an approach like this to aggregate spatial data for a heatmap based on property values today @tempranova - https://bl.ocks.org/ryanbaumann/a8d7016227a7aaefd18ab93ff6c95102/c3f33b2ba7a218b16db8318ec03779ffa5de1bd6 before the new #7584 feature is finished.

@Obi-Dann
Copy link

Wondering if it’s possible now with #7584 merged. Looked at the documentation and the source but couldn’t find a way to do it.
@ryanbaumann do you have any advice? Thanks!

@cscetbon
Copy link

Same @ryanbaumann @mourner I'm not sure this answered the question. Any example on how to do it to create a heatmap based on temperatures for instance ?

@cscetbon
Copy link

You can try creating multiple heatmap layers, each for the specific value range that you want to show density for. Otherwise I don't have any tips to offer — the heatmap layer is specifically designed to show point density.

@mourner Have you ever tried this ? Do you have an example showing that it would work ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants