Infowindow bug fix - partial
diff --git a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
index 5e28dbd..f5aa9f6 100755
--- a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
+++ b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
@@ -14,6 +14,8 @@
review_mode_handles = [];
map_cells = [];
+ countInfoWindow = null;
+ count_info = [];
map_tweet_markers = [];
// UI Elements - Modals & perspective tabs
@@ -473,6 +475,8 @@
// Compute data point spread
var dataBreakpoints = mapWidgetLegendComputeNaturalBreaks(plotWeights);
+ var mapper = {};
+
$.each(mapPlotData, function (m, val) {
// Only map points in data range of top 4 natural breaks
@@ -498,18 +502,32 @@
};
var map_circle = new google.maps.Circle(map_circle_options);
map_circle.val = mapPlotData[m];
+ map_circle.index = m;
+
+ var iF = new google.maps.InfoWindow({
+ content : mapPlotData[m].weight + " Tweets",
+ position : point_center
+ });
- // Clicking on a circle drills down map to that value
+ // Clicking on a circle drills down map to that value, hovering over it displays a count
+ // of tweets at that location.
google.maps.event.addListener(map_circle, 'click', function (event) {
onMapPointDrillDown(map_circle.val);
});
+ google.maps.event.addListener(map_circle, 'mouseover', function (event) {
+ mapper[map_circle.index].open(map, map_circle);
+ });
+
+ google.maps.event.addListener(map_circle, 'mouseout', function (event) {
+ mapper[map_circle.index].close();
+ });
+
// Add this marker to global marker cells
map_cells.push(map_circle);
}
});
- // Add a legend to the map
// TODO Remove widget for now mapControlWidgetAddLegend(dataBreakpoints);
}
@@ -1095,6 +1113,8 @@
map_cells[c].setMap(null);
}
map_cells = [];
+ countInfoWindow = null;
+ count_info = [];
for (m in map_tweet_markers) {
map_tweet_markers[m].setMap(null);
}