Skip to content

Commit

Permalink
#125 reset weight
Browse files Browse the repository at this point in the history
  • Loading branch information
webgisdeveloper committed Jul 27, 2021
1 parent cf3aa56 commit bcb85fc
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions simccs_maptool/templates/simccs_maptool/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1789,11 +1789,23 @@ <h5 class="modal-title">Generate MPS file</h5>
return mymarker;
}
});
// 0-0.25, 0.25-5, 5-7.5, 10

var result_networkLayer = new L.geoJSON(data["Network"],{style:{color:"blue",opacity:0.5,weight:4,pane:"linesPane"},
onEachFeature: function (feature, layer) {layer.bindPopup("Flow: " + feature.properties.Flow +"<br/>Length (KM): "+feature.properties.LengKM);}
});

// reset style
// 0-0.25, 0.25-5, 5-7.5, 10
result_networkLayer.eachLayer(function(layer) {
var fv = layer.feature.properties['Flow'];
var lw = 1;
if (fv <= 0.25) {lw = 1;}
else if (fv>0.25 && fv <= 5) {lw = 2;}
else if (fv > 5 && fv <= 7.5 ) {lw = 3;}
else if (fv > 7.5 && fv <= 10) {lw = 4;}
else if (fv > 10) {lw=5;}
else {lw=1;}
layer.setStyle({weight:lw+1});
});
map.addLayer(result_sinkLayer);
map.addLayer(result_sourceLayer);
map.addLayer(result_networkLayer);
Expand Down

0 comments on commit bcb85fc

Please sign in to comment.