summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-09-09 03:43:10 +0200
committerJonas Smedegaard <dr@jones.dk>2015-09-09 03:43:10 +0200
commit82986488864cbd7b2122d036f4001790b57b2fec (patch)
treeff6cf9291140e2a6c823f91641e8c2eedc6607df
parentf67705f4c95eb75b3aa0bf7cbe2b5175a9644a59 (diff)
Use colored circles.
-rw-r--r--map.js13
1 files 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) {