Преглед изворни кода

[search] Plugged in Leaflet map charts for the grid results

Enrico Berti пре 10 година
родитељ
комит
ded9e6b
1 измењених фајлова са 10 додато и 0 уклоњено
  1. 10 0
      apps/search/src/search/templates/search.mako

+ 10 - 0
apps/search/src/search/templates/search.mako

@@ -2575,6 +2575,16 @@ function leafletMapChartDataTransformer(data) {
 
 function leafletMapChartDataTransformerGrid(data) {
   var _data = [];
+  $(data.counts).each(function (cnt, item) {
+    var _obj = {
+      lat: item.item[viewModel.collection.template.chartSettings.chartX()](),
+      lng: item.item[viewModel.collection.template.chartSettings.chartYSingle()]()
+    }
+    if (viewModel.collection.template.chartSettings.chartMapLabel() != "") {
+      _obj.label = item.item[viewModel.collection.template.chartSettings.chartMapLabel()]();
+    }
+    _data.push(_obj);
+  });
   return _data;
 }