浏览代码

[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;
 }