Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
set add/remove listener in load/unload spot list page
  • Loading branch information
andrewsmedina committed Aug 16, 2010
1 parent 59d2fb3 commit b928045
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 1 addition & 7 deletions wifimap/media/js/map.js
Expand Up @@ -18,13 +18,7 @@ var Map = {
content: 'content' content: 'content'
}); });


this.markers = []; this.markers = [];


google.maps.event.addListener(Map.map, 'dragend', function() {
SpotManager.getAccessPointsListByBounds();
});

}, },


followCenter: function(callback) { followCenter: function(callback) {
Expand Down
9 changes: 9 additions & 0 deletions wifimap/media/js/page.js
Expand Up @@ -103,9 +103,18 @@ var SpotListPage = {
SpotManager.getAccessPointsListByBounds(); SpotManager.getAccessPointsListByBounds();
SpotManager.addSpotsToMap(); SpotManager.addSpotsToMap();
}); });

Map.dragendListener = google.maps.event.addListener(Map.map, 'dragend', function() {
SpotManager.getAccessPointsListByBounds();
});

}, },
unload: function() { unload: function() {
Map.removeAllMarkers(); Map.removeAllMarkers();

if (Map.dragendListener)
google.maps.event.removeListener(Map.dragendListener);

} }
}; };


Expand Down

0 comments on commit b928045

Please sign in to comment.