Should probably have this code compiling before I go refactoring

This commit is contained in:
danzel
2012-07-18 11:00:05 +12:00
parent e32c4de14c
commit f03acfaecf
2 changed files with 6 additions and 19 deletions

View File

@@ -65,21 +65,8 @@
if (a.layer instanceof L.MarkerCluster) {
console.log('cluster ' + a.layer.getAllChildMarkers().length);
//a.layer.zoomToBounds();
var ms = a.layer.getAllChildMarkers();
var p = [];
for (var i = 0; i < ms.length; i++) {
var ll = ms[i].getLatLng();
p.push([ll.lat, ll.lng]);
}
var hull = L.QuickHull.getConvexHull(p);
var hullll = [];
for (var i = 0; i < hull.length; i++) {
var p = hull[i];
var ll = new L.LatLng(p[0][0], p[0][1]);
hullll.push(ll);
}
var path = new L.Polygon(hullll);
var path = new L.Polygon(a.layer.getConvexHull());
map.addLayer(path);
} else {
console.log('marker ' + a.layer);

View File

@@ -103,14 +103,14 @@ L.MarkerCluster.include({
hullLatLng = [],
hull, p, i;
for (var i = ms.lenght; i >= 0; i--) {
ll = ms[i].getLatLng();
points.push([ll.lat, ll.lng]);
for (i = childMarkers.length - 1; i >= 0; i--) {
p = childMarkers[i].getLatLng();
points.push([p.lat, p.lng]);
}
hull = L.QuickHull.getConvexHull(points);
for (var i = 0; i < hull.length; i++) {
for (i = 0; i < hull.length; i++) {
p = hull[i];
hullLatLng.push(new L.LatLng(p[0][0], p[0][1]));
}