cyrilcherian / million-points-on-map Goto Github PK
View Code? Open in Web Editor NEWShow Million Points On Map Using Leaflet And Elastic
Show Million Points On Map Using Leaflet And Elastic
Greeting,
do i have to run parse server locally in order to pass this error?
Could you clarify the format in which you're putting data into elasticsearch for someone who is not quite as familiar with elasticsearch?
Index was created with the supplied example
I've tried my data in this format (these being results from an empty search)
{
"_index" : "points",
"_type" : "point",
"_id" : "AVEaYXOzCKM7Hs_jae0G",
"_score" : 1.0,
"_source":{"point":{"lat":13.964871,"lon":100.37347}}
}
as well as
{
"_index" : "points",
"_type" : "point",
"_id" : "AVEaYXOzCKM7Hs_jae0G",
"_score" : 1.0,
"_source":{"location":{"lat":13.964871,"lon":100.37347}}
}
and
{
"_index" : "points",
"_type" : "point",
"_id" : "AVEaaPfmCKM7Hs_jae0T",
"_score" : 1.0,
"_source":{"point":{"location":{"lat":50.706843,"lon":-1.285245}}}
}
and
{
"_index" : "points",
"_type" : "point",
"_id" : "AVEaa4FrCKM7Hs_jae0e",
"_score" : 1.0,
"_source":{"point":[51.531011,-0.012336]}
}
But when running a query, I get the following;
QueryParsingException[[points] failed to find geo_point field [point]]
Good day !
Parse.com is down, can you please update code, to make query to ElasticSearch search ?
Thanks !
Hi,
First of all. This work is absolutely brilliant! Thank you very much for sharing the example.
I have a question related to the OnHover feature. When I move over a cluster Leftlet shows the bounds of its markers. However in your function "makePoints(aggs)" you make the markers based on the buckets "makePoints(r.aggregations.zoom.buckets);". For each bucket, you decode the key to get its center and create a marker with that center. The marker has count and sentiment.
var markerList = [];
aggs.forEach(function(agg, index){
//var obj = {};
//obj.id = guid();
//var bounds = geohash.decode_bbox(agg.key);
var center = geohash.decode (agg.key);
var avg = Math.ceil(agg.sentiment_avg.value)
var myIcon = L.divIcon({ html: '<div class="clustergroup'+avg+' leaflet-marker-icon marker-cluster marker-cluster-medium leaflet-zoom-animated leaflet-clickable" tabindex="0" style="margin-left: -20px; margin-top: -20px; width: 40px; height: 40px; z-index: 233;"><div><span>'+agg.doc_count+'</span></div></div>' });
var marker = L.marker(new L.LatLng(center.latitude, center.longitude),{icon:myIcon});
marker.count = agg.doc_count;
marker.sentiment = agg.sentiment_avg.value;
marker.bindPopup(''+agg.doc_count);
markerList.push(marker);
/*obj.min = min;
obj.max = max;
obj.center = center;
obj.count = agg.doc_count;
points[obj.id] = obj; */
});
markers.addLayers(markerList);
So, how is Leaflet able to show the bounds of the cluster elements?
Thanks,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.