Permalink
Browse files

Group the overlay clearing with the creation, so you don't get cases …

…where there are two identical overlays making everything really dsaturated.
  • Loading branch information...
1 parent 82544be commit 22506bbff0d6f213758ac2157b310d0ba74c39a5 @lehrblogger committed Jan 17, 2012
Showing with 2 additions and 4 deletions.
  1. +1 −1 scripts/manage_foursquare_data.py
  2. +1 −3 static/wdyg-private.js
View
2 scripts/manage_foursquare_data.py
@@ -52,8 +52,8 @@ def fetch_and_store_checkins(userinfo, limit):
userinfo.put()
return 0, 0
history['checkins']['items'].reverse()
+ logging.debug('will process %d items' % (len(history['checkins']['items'])))
for checkin in history['checkins']['items']:
- logging.debug('will process %d items' % (len(history['checkins']['items'])))
if 'venue' in checkin:
j_venue = checkin['venue']
if 'id' in j_venue:
View
4 static/wdyg-private.js
@@ -21,6 +21,7 @@ function redrawTiles() {
map.addOverlay(tilelayeroverlay);
}
function createHeatMap(timeout) {
+ map.clearOverlays();
clearTimeout(tile_timeout);
tile_timeout = setTimeout('redrawTiles();', timeout);
}
@@ -39,7 +40,6 @@ function updateLevels(offset) {
east = bounds.getNorthEast().lng(),
south = bounds.getSouthWest().lat(),
west = bounds.getSouthWest().lng();
- map.clearOverlays();
level_offset += offset;
$.get("/update_user_level/" + level_offset + "/" + north + "," + west + "/" + south + "," + east, function(){
createHeatMap(500);
@@ -105,7 +105,6 @@ $(document).ready(function() {
map.setCenter(new GLatLng(global_centerlat, global_centerlng), global_zoom);
GEvent.addListener(map, "zoomend", function(oldLevel, newLevel) {
- map.clearOverlays();
createHeatMap(1000);
});
var customUI = map.getDefaultUI();
@@ -167,7 +166,6 @@ $(document).ready(function() {
});
$("#color_select").change(function() {
- map.clearOverlays();
$.get("/update_user_color/" + $("#color_select").val(), function(){
createHeatMap(0);
});

0 comments on commit 22506bb

Please sign in to comment.