Comments (6)
Yes. Just not directly through this library. I'll try to post some code soon; I've had to modify both this library and simpleheat.js to do this.. The problem about this library is that it just draws and averages your points onto a canvas. First, once it's done that, it has no knowledge about what's been drawn where. Your points are just pixels on a canvas. Secondly- and you'll see other people complain about this- there's no way of really distinguishing high and low point values from one another. It just all renders as bunch of blobs. I'm sure that has its uses, but it's not useful for things like that demographic map. One really high-value point is indistinguishable from a bunch of low-value points clustered together. I'm wondering if the maplarge demo, and what I need for my map, isn't really a "heat map" by popular definition, but something that looks and feels like a heatmap but retains the functionality of having a large number of individual points.
To do this, keep your latlongs in a kdtree - I'm using ubilabs/kdtree.js - take a look at their demo that follows your mouse and draws the closest points. Basically, you can use their library to do the same thing, so that as you move your mouse around and/or click, it finds the closest lat/long it can find in your list to where your mouse is. I've got this working in complete real-time with 90k+ points, much faster than the maplarge demo. Again, I will try to post code soon, but if you can't wait, my json with the addresses looks like this:
var addressPoints = [
{"latitude":123.456,"longitude":-1.234,"otherstuff":12345,"grad":59,"stuff":20553},
...
then to give heatLayer something to work with, (I haven't quantified how inefficient this is, but performance is good on all the devices I've tried)
coolPoints = addressPoints.map(function (p) { return [p.latitude, p.longitude, p.grad]; });
good luck!
from leaflet.heat.
Hi @beastlike,
thank you very much for the detailed information, I am not in a hurry for this but if I try it I'll come back here to share results. Thanks.
from leaflet.heat.
Also just to share our use case. We are using heat to show criminal areas and each crime is a point of course but it has important information like the kind of crime.
Heatmap gives us a nice insight of where the majoroty of crimes are being commited but we have no information about the kind of crimes. For now we are using another layer (using sames crime points) combined with heatmap to show additional information.
from leaflet.heat.
I also would like to 'interact' with a heat point to show additional information, is it possible?
from leaflet.heat.
hi @beastlike,
Just want to know where's the code you post? Looking forward to it!
from leaflet.heat.
@rmpestano
Using another layer?
from leaflet.heat.
Related Issues (20)
- IndexSizeError: Index or size is negative or greater than the allowed amount HOT 2
- maxZoom in leaflet HOT 2
- Need demo for adding heat using click
- Is it possible to change the intensity color based on the number of heatpoints combined in view? HOT 6
- Heatlayer radius over 80 creates strange object outside default heat HOT 6
- Layering different heat maps on top of eachother
- Crashes when container has 0 width/height HOT 2
- Zooming to bounds of points added. HOT 1
- How to add popup to heat points. HOT 1
- Crash on Firefox 72 on Mac (script is "blocked from extracting canvas data") HOT 7
- Laggy Heatmaps
- Demos don't work: Blocked loading mixed active content HOT 1
- ERROR: ENOENT: no such file or directory, open 'node_modules/simpleheat/simpleheat.js' HOT 1
- Not working offline HOT 1
- Uncaught TypeError: L.heatLayer is not a function HOT 2
- MaxOpacity HOT 2
- Intensity doesn't affect gradient HOT 1
- New npm release HOT 1
- possible to add a legend ?
- Heatmap Gradient disapears when zooming in
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.heat.