What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

On the search page http://careers.stackoverflow.com/employer/search the map is just great.

I am interested in technology behind it.

What is used to draw the markers client-side?

Where aggregation of events is performed, on the client or on the server?

Whats is the Database behind it?

Any additional details would help as well?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

The map is google maps API, and the marker plugin is called google maps clusterer. The clusterer lets you set custom icons for the aggregated markers. Originally the clusterer showed the default pin for a cluster with one point in it, so we updated it to still show the custom cluster icon. In a later version (which we are using now), they added it as an option called minimumClusterSize.

This works pretty fast client side, however when you have a ton of points, like when you hit the default search page and get the entire set of candidates, it was a little slow. We found it was much faster if you created the points first without adding them to the map, and letting the clusterer add only the groups instead. That was probably the biggest client side win.

Additionally, passing down all of the points for the entire searchable candidate collection generated a large packet to send over the wire. The clusterer already supported a custom aggregation function to be set via the myClusterer.setCalculator function. Server side we group the results by geo location id and only pass down counts for each point. So in essence, each point on the map is worth one or more actual results, which we attach by adding a Count property right on to the gmap marker object for each lat/long combo. The calculator just sums up the counts instead of counting the number of markers. This reduced the number of markers needed which reduced the amount of data going over the wire. For instance, right now we have 57904 candidates and the aggregated locations only required 9111 points.

The biggest overall win was in changing how the data is sent down. We were originally passing a json object that looked like

[{lat:4743,lon:-12175,count:19},...]

So for all 9000 points we'd have to send down these useless characters: lat:lon:count:... for each location. That's 14 useless characters per location, or roughly 14 * 9111 * 2 (16 bit encoding) = 255,108 useless bytes. Granted at the time we had significantly less people in our database, but the impact is roughly linear. A better way to send traffic over the wire is to pack the values into an array

[[4743,-12175,19],...]

You can see the difference it makes already. That's basically it for the map.

In writing this I found that there is a new google maps marker clusterer plus in case anyone is interested.

share|improve this answer
    
Thanx a lot for you answer. As I understand, initially used the plugin, but ended up with server side clustering. What DB are you using? I am trying to do something similar, using MongoDB. –  tzador Jun 4 '12 at 18:04
    
We are using sql server 2008 today. We have a table of geo data which stores a bounding boxand an id. We group by id and count, then we pull the center of the bounding box to place the marker. –  NickLarsen Jun 4 '12 at 19:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .