我正在映射Mars的书目信息,并希望在Leaflet中关联两个表(键列:feature_ID)。我的目标是在单击geojson表1中的功能时显示csv表2信息窗口的弹出窗口。但是,我不知道如何执行此操作。有谁知道我应该在哪里参考?
$.getJSON("mapdata.geojson",function(hoodData){
L.geoJson( hoodData , {
style: function(feature){
var fillColor,
number_of_papers = feature.properties.number_of_papers;
if ( number_of_papers > 80 ) fillColor = "#006837";
else if ( number_of_papers > 40 ) fillColor = "#31a354";
else if ( number_of_papers > 20 ) fillColor = "#78c679";
else if ( number_of_papers > 10 ) fillColor = "#c2e699";
else if ( number_of_papers > 0 ) fillColor = "#ffffcc";
else fillColor = "#f7f7f7"; // no data
return { color: "#999", weight: 1, fillColor: fillColor, fillOpacity: .6 };
},
onEachFeature: function( feature, layer ){
layer.bindPopup( "<strong>" + feature.properties.Clean_Feature_Name + "</strong><br/>" + "Number of Papers: " + feature.properties.number_of_papers + "<br/>" + "Number of Citing Papers: " + feature.properties.number_of_citing_papers + "<br/>" + "Number of self citations: " + feature.properties.number_of_self_citations + "<br/>" + "Total number of citations: " + feature.properties.total_number_of_citations + "<br/>" + "Number of referred citations: " + feature.properties.total_number_of_refereed_citations )
}
} ).addTo(map);
到目前为止我创建的地图:https://shinjjo.github.io/heatmap.html 数据:https://github.com/shinjjo/shinjjo.github.io