Update the build

This commit is contained in:
danzel
2012-08-27 13:03:21 +12:00
parent c1aff5cba2
commit 1ade0834b8
2 changed files with 20 additions and 6 deletions
+19 -5
View File
@@ -38,6 +38,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
},
addLayer: function (layer) {
if (layer instanceof L.LayerGroup)
{
for (var i in layer._layers) {
if (layer._layers.hasOwnProperty(i)) {
this.addLayer(layer._layers[i]);
}
}
return this;
}
if (!this._map) {
this._needsClustering.push(layer);
return this;
@@ -1126,7 +1137,9 @@ L.DistanceGrid.prototype = {
getNearObject: function (point) {
var x = this._getCoord(point.x),
y = this._getCoord(point.y),
i, j, k, row, cell, len, obj;
i, j, k, row, cell, len, obj, dist,
closestDistSq = this._sqCellSize,
closest = null;
for (i = y - 1; i <= y + 1; i++) {
row = this._grid[i];
@@ -1138,16 +1151,17 @@ L.DistanceGrid.prototype = {
for (k = 0, len = cell.length; k < len; k++) {
obj = cell[k];
if (this._sqDist(obj._dGridPoint, point) < this._sqCellSize) {
return obj;
dist = this._sqDist(obj._dGridPoint, point);
if (dist < closestDistSq) {
closestDistSq = dist;
closest = obj;
}
}
}
}
}
}
return null;
return closest;
},
_getCoord: function (x) {
+1 -1
View File
File diff suppressed because one or more lines are too long