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

Why is the rest of the map darkened? #13

Closed
FunkMonkey33 opened this issue Jan 28, 2013 · 3 comments
Closed

Why is the rest of the map darkened? #13

FunkMonkey33 opened this issue Jan 28, 2013 · 3 comments

Comments

@FunkMonkey33
Copy link

The HeatMap looks great, but when placed over a base layer it significantly darkens the map such that it's difficult to see what's going on underneath. I'm using the default opacity of 0.6.

It seems like the Heatmap.Canvas is writing black for all the places that don't have data. Is that accurate? Is there a way to turn that off?

Thanks.

@sunng87
Copy link
Owner

sunng87 commented Jan 29, 2013

Yes, you can override heatcanvas.bgcolor by an RGBA array before rendering. For example:

heatcanvas.bgcolor = [100,0,0,255]

On changing background color, You may also want change default color schema. Just pass a function to render which takes a value (in range [0,1]) and returns an HSLA array for that value.

@sunng87 sunng87 closed this as completed Jan 29, 2013
@FunkMonkey33
Copy link
Author

On changing the color schema: can you explain a little more how the default works? In other words, if I just push in some values at a particular location, what determines the color at that exact location, and what determines the color and thickness of the concentric blobs around that location? Also, what are the range of values that the render function expects (i.e. between [0,1], [0,255] etc.)?

Thanks.

@sunng87
Copy link
Owner

sunng87 commented Jan 30, 2013

You can not define a color for a particular location, but a particular value, by overriding the default color schema function. And the default function looks like this: https://github.com/sunng87/heatcanvas/blob/master/heatcanvas.js#L153

For the range, consult the documentation: https://github.com/sunng87/heatcanvas#3-render-the-map

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

2 participants