From 426eb4711ff92cc0e6df9cd1004ff322f112c814 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 5 Apr 2013 14:28:35 +0200 Subject: Weighted markers: first display with Leaflet --- chimere/static/chimere/js/jquery.chimere-leaflet.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'chimere/static') diff --git a/chimere/static/chimere/js/jquery.chimere-leaflet.js b/chimere/static/chimere/js/jquery.chimere-leaflet.js index 569f9f5..5e0e811 100644 --- a/chimere/static/chimere/js/jquery.chimere-leaflet.js +++ b/chimere/static/chimere/js/jquery.chimere-leaflet.js @@ -125,12 +125,21 @@ See the file COPYING for details. layer.bindPopup(feature.properties.name); }, pointToLayer: function (feature, latlng) { - if (feature.properties.weigthed){ + if (feature.properties.weight){ + var fill_color = "#ff7800"; + if (feature.properties.colors){ + var idx = feature.properties.weight/5; + if (idx < feature.properties.colors.length){ + fill_color = feature.properties.colors[idx]; + } else { + fill_color = feature.properties.colors[feature.properties.colors.length-1]; + } + } var geojsonMarkerOptions = { - radius: 8, - fillColor: "#ff7800", + radius: feature.properties.weight*2, + fillColor: fill_color, color: "#000", - weight: 1, + weight: feature.properties.weight/2, opacity: 1, fillOpacity: 0.8 }; -- cgit v1.2.3