Permalink
Browse files

started new clustering method

  • Loading branch information...
1 parent 0b4e995 commit 9ac961d2beb0a2611b27a070880709dffc5d53f9 @jrasky jrasky committed May 10, 2012
Showing with 10 additions and 6 deletions.
  1. +6 −3 TODO.txt
  2. +4 −3 geocamLayer/management/commands/restruct.py
View
@@ -4,6 +4,8 @@ Todo list for geocamlayer
- Figure out clustering, once and for all.
+- Use JQuerry moar
+
- Actually get kml working
- Top level link that will load the kml in gearth and do the right stuff
@@ -23,10 +25,11 @@ Done list
- make install process as easy as possible
Bug List
-
-- tile loading is still tempremental
- - this has gotten better, still not very good
- clustering has issues
- as the zoom level increases, it gets worse
- points are not showing up consistently for some reason
- Clusters are still being weird
+
+possibilities
+
+- not having indent = 4 on the json
@@ -12,16 +12,17 @@
NUMBER_ZOOMS = 10
class Cluster(object):
- def __init__(self, finalZoom = False):
+ def __init__(self, finalZoom = False, cluster=True):
self.numPoints = 0
self.xSum, self.ySum = 0,0
self.south = self.west = self.east = self.north = None
self.points = []
self.finalZoom = finalZoom
+ self.cluster = cluster
def add_point(self, point):
self.numPoints += 1
- if self.numPoints == 1 or self.finalZoom:
+ if self.numPoints == 1 or self.finalZoom or not self.cluster:
self.points.append(point)
else:
self.points = []
@@ -39,7 +40,7 @@ def add_point(self, point):
def get_json(self):
data = []
- if self.numPoints > 1 and not self.finalZoom:
+ if self.numPoints > 1 and not self.finalZoom and self.cluster:
data.append({'type': 'Feature',
'geometry': {
'type': 'Point',

0 comments on commit 9ac961d

Please sign in to comment.