summaryrefslogtreecommitdiff
path: root/chimere/static
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-04-05 14:28:35 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-04-05 14:28:35 +0200
commit426eb4711ff92cc0e6df9cd1004ff322f112c814 (patch)
treea1884d4c36beb027207a964974ca3f7c3d0a9eb5 /chimere/static
parent1ab25dfc2603d6145a7ca6100558e470761ce766 (diff)
downloadChimère-426eb4711ff92cc0e6df9cd1004ff322f112c814.tar.bz2
Chimère-426eb4711ff92cc0e6df9cd1004ff322f112c814.zip
Weighted markers: first display with Leaflet
Diffstat (limited to 'chimere/static')
-rw-r--r--chimere/static/chimere/js/jquery.chimere-leaflet.js17
1 files changed, 13 insertions, 4 deletions
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
};