-
Notifications
You must be signed in to change notification settings - Fork 525
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
fixed radius #19
Comments
Nice suggestion, I'll look into it — shouldn't be hard to implement. Just need to recalculate the radius on each zoom. |
Also, in my opinion, having the radius expressed in meters by default makes more sense than pixels in that case. Let me know if I can help in anything. Cheers |
Having a similar but not exactly the same issue here. map.on('zoomend', function() {
// remove existing layer
map.removeLayer(old_layer);
// add in new
new_layer = L.geoJson(data, data_options);
map.addLayer(new_layer);
}); and in my data_options, I implemented the resizing method var data_options = {
pointToLayer: function(feature, latlng) {
mk = L.circleMarker(latlng);
var pointC = map.latLngToContainerPoint(latlng);
var pointX = [pointC.x + 1, pointC.y];
// convert containerpoints to latlng's
var latLngC = map.containerPointToLatLng(pointC);
var latLngX = map.containerPointToLatLng(pointX);
// Assuming distance only depends on latitude
var distanceX = latLngC.distanceTo(latLngX);
// 100 meters is the fixed distance here
var pixels = 100 / distanceX;
mk.setRadius(pixels);
return mk;
}
}; Hope this helps! |
any updates here? re-drawing of whole heatmap doesn't solve my problem |
http://leafletjs.com/reference.html#circle Other than this point, you may want to check out some other statistical stuff for more accurate "heat" calculation. |
Hi folks! Firstly @mourner thank you for this plugin! Any update on this feature? |
+1 |
I think i made something looks like fixed radius |
@kuzvac Does keeping the radius fixed avoid merging of the lat/lng value colors on zoom out? |
@cpunekar can you please explain more detailed? |
Thanks @kuzvac for the reply. I wanted to have fixed radius when I asked this question but now since the intensity value of points get added as we zoom out, I was curious if we can recalculate the radius each time we zoom in and out. As in I want the radius to increase when we zoom in and to decrease when we zoom out. This would give me a better picture of the intensity values as I am not looking for density heatmap. |
Hi,
I'd like my heat point around
lat/lng
to have a fixed (zoom independent) radius of 500m : how can I specify this ?Thank you
The text was updated successfully, but these errors were encountered: