Showing posts with label MongoDB. Show all posts
Showing posts with label MongoDB. Show all posts
Saturday, February 11, 2012
Bing Maps and HTML5 (Part 3 - Optimizing)
In my previous post I've created an example where about 140.000 points are retrieved from a MongoDB database and drawn on top of a Bing Maps using Html5 canvas.
If you recall, it took about 800+ ms to create and display the canvas above the map when all the points were visible. For the current scenario it's acceptable, as the drawing only occurs after the view changed event has ended. The problem is that I would like to have the drawing being continuously drawn during the view changed events. So, and for the motion to be fluid, each canvas image has to be drawn in less than 40 ms(1000/25).
Obviously it depends on the CPU of the client machine. My laptop is pretty average, so it will be a realistic benchmark. I'll post my attempts to achieve the 40ms target on my computer, starting with the current post, where I try to solve the most problematic operation.
Friday, February 10, 2012
Bing Maps and HTML5 (Part 2 - Canvas)
In my previous post I've created a very simple example of a map that fetches a bunch of coordinates from a Node.js server using HTML5 websockets.
As promised, I'm going to extend that example so that much more coordinates are fetched and displayed.
I've used a MongoDB database and loaded it with most of the Portuguese localities, on a total of 142912 coordinates. As one may suspect, it's impossible to draw so many pushpins on a map without resorting to some type of clustering technique. I won't do the clustering (at least on this post), and will instead draw them using one of the HTML5 goodies: the Canvas element.
Sunday, February 5, 2012
Fast display of data in a map
Recently the HTML5 bandwagon has gained a lot more traction, and I'm going to develop a prototype for a map with fast client-side drawing on top of it, using some of the goodies that HTML5 provides us.
The basic idea is:
- Bing Maps or Leaflet mapping-wise
- Html5 Canvas to draw the data (points, heatmaps, grids, whatever)
- Html5 websockets to fetch the data
- NodeJS to create an ultra-fast server to return the data to the client (without HTTP protocol overhead, just a plain TCP socket).
- MongoDB to handle the data.
Also, I want to be able to handle thousands (if not millions) of coordinates at once.
Subscribe to:
Posts (Atom)