fix a bug where the n largest places would not appear in a map view

This commit is contained in:
rolux 2011-05-24 14:02:08 +02:00
parent 0e5172a8fa
commit 6ad45105af

View file

@ -716,9 +716,9 @@ Ox.Map = function(options, self) {
self.places.sort(function(a, b) { self.places.sort(function(a, b) {
var sort = { var sort = {
a: a.selected ? Infinity : a: a.selected ? Infinity :
bounds.contains(a.center) ? a.size : -Infinity, bounds.contains(a.center) ? a.area : -Infinity,
b: b.selected ? Infinity : b: b.selected ? Infinity :
bounds.contains(b.center) ? b.size : -Infinity, bounds.contains(b.center) ? b.area : -Infinity,
}; };
return sort.b - sort.a; return sort.b - sort.a;
}).forEach(function(place, i) { }).forEach(function(place, i) {