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

Heat layer is not changed when working with many points. #97

Open
divinocfelix opened this issue Jan 3, 2018 · 0 comments
Open

Heat layer is not changed when working with many points. #97

divinocfelix opened this issue Jan 3, 2018 · 0 comments

Comments

@divinocfelix
Copy link

divinocfelix commented Jan 3, 2018

Good afternoon.

I am building a dynamic heat map using elasticsearch, so the amount of points can vary according to the precision reported by the user, but when I have a lot of points I can not see changes on the map.

By doing some tests, I saw that the latLngToContainerPoint function in the leaflet.js file converts different data to the same point on the map, making a considerable reduction in the number of points that are drawn, thus not allowing the map to be wide.
An example is the data below, which are converted to the same point (x = 500, y = 400)

[-19.9155, -43.94, 1115]
[-19.921, -43.94, 933]

Obs.
1 The problem can be verified using the examples map1 and map2.
2. In map2, the function that constructs the heat layer (_createHeatLayer) is only using 1/3 of the points, so that the change in the heat layer becomes noticeable.
3º To simulate the problem open the files map1 is map2, then click add and subtract precision.

Example
Map1 - precision 8
map1

Map2 - precision 8
map2

files for testing
https://github.com/divinocfelix/Leaflet-heat-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

1 participant