From cad7245af24e0c4084d5e26bc731cfbff003f10b Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Fri, 30 Nov 2012 23:55:35 +0000 Subject: modules/freifunk: simplify colors in map, add a legend --- modules/freifunk/luasrc/view/freifunk-map/map.htm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'modules/freifunk/luasrc/view/freifunk-map/map.htm') diff --git a/modules/freifunk/luasrc/view/freifunk-map/map.htm b/modules/freifunk/luasrc/view/freifunk-map/map.htm index f373a7a6b7..02b1afdab0 100644 --- a/modules/freifunk/luasrc/view/freifunk-map/map.htm +++ b/modules/freifunk/luasrc/view/freifunk-map/map.htm @@ -43,11 +43,22 @@ if (null != alias[fromip]) fromip = alias[fromip]; if (null != points[fromip] && null != points[toip]) { - var w = 1; - if (etx < 4) w++; - if (etx < 2) w++; + var color; + var red = 240; + var green = 0; + var blue = 0; + var w = 1 + + if (etx < 100) {red=252;green=102;blue=0;w=2}; + if (etx < 10) {red=255;green=203;blue=5;w=3}; + if (etx < 4) {red=240;green=255;blue=0;w=4}; + if (etx < 2) {red=0;green=204;blue=0;w=5}; + if (etx < 1) {red=80;green=0;blue=0;w=1}; + map.AddPolyline(new VEPolyline('id'+lineid, [points[fromip], points[toip]], - new VEColor(102,Math.floor(lq*255.0),Math.floor(nlq*255.0),1.0), w)); + new VEColor(red, green, blue, 0.5), w)); + + } else { -- cgit v1.2.3