From 82986488864cbd7b2122d036f4001790b57b2fec Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 9 Sep 2015 03:43:10 +0200 Subject: Use colored circles. --- map.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/map.js b/map.js index c39421a..0d59bce 100644 --- a/map.js +++ b/map.js @@ -6,13 +6,22 @@ var OSMLayer = L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { att var Box = L.latLngBounds( [[54.5, 8.0],[57.8, 15.3]] ); // GeoJSON feature styling and grouping +function typecolor(type) { + if (type == "center") { return ('darkgreen'); } + else if (type == 'center-begin') { return ('green'); } + else if (type == 'member') { return ('orange'); } + else if (type == 'diploma') { return ('red'); } + else if (type == 'diploma-aspiring') { return ('blue'); } + else { return ('black'); }; +}; function returnFeatureMarker(feature, latlng) { var hasPopup = (feature.properties.location && feature.properties.type); - return L.marker(latlng, { + return L.circleMarker(latlng, { title: feature.properties.title, zIndexOffset: 1000*feature.properties.priority || 0, clickable: hasPopup, - keyboard: hasPopup + keyboard: hasPopup, + color: typecolor(feature.properties.type) }); }; function addFeaturePopup(feature, layer) { -- cgit v1.2.3