From 18bbee96bae9b018cd7006741caeb0bb1b69433f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Tue, 9 Jan 2018 21:17:34 +0100 Subject: [PATCH] Rename style 'weight' in 'width' --- README.md | 2 +- src/CategoryOverpass.js | 2 +- src/markers.js | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4455a892..a06c76e9 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ The following values are possible for categories (the only mandatory value is qu * feature: an object describing how the feature will be formated resp. styled. * style: a Leaflet style. * stroke: Whether to draw stroke along the path. Set it to false or empty string to disable borders on polygons or circles. (boolean, true) - * weight: Stroke width in pixels (number, 3) + * width: Stroke width in pixels (number, 3) * color: Stroke color (string, '#3388ff') * opacity: Stroke opacity (number, 1.0) * lineCap: shape at end of the stroke (string, 'round') diff --git a/src/CategoryOverpass.js b/src/CategoryOverpass.js index a459d62e..ada7d88a 100644 --- a/src/CategoryOverpass.js +++ b/src/CategoryOverpass.js @@ -11,7 +11,7 @@ var defaultValues = { markerSign: '', 'style:hover': { color: 'black', - weight: 3, + width: 3, opacity: 1, radius: 12, fill: false diff --git a/src/markers.js b/src/markers.js index b2c9447f..9e5c6e96 100644 --- a/src/markers.js +++ b/src/markers.js @@ -5,9 +5,7 @@ function cssStyle (style) { if ('color' in style) { ret += 'stroke: ' + style.color + ';' } - if ('weight' in style) { - ret += 'stroke-width: ' + style.weight + ';' - } + ret += 'stroke-width: ' + ('width' in style ? style.width : '3') + ';' if ('dashArray' in style) { ret += 'stroke-dasharray: ' + style.dashArray + ';' } @@ -80,17 +78,17 @@ function markerPolygon (data) { function markerCircle (style) { var fillColor = 'fillColor' in style ? style.fillColor : '#f2756a' var color = 'color' in style ? style.color : '#000000' - var weight = 'weight' in style ? style.weight : 1 + var width = 'width' in style ? style.width : 1 - return '' + return '' } function markerPointer (style) { var fillColor = 'fillColor' in style ? style.fillColor : '#f2756a' var color = 'color' in style ? style.color : '#000000' - var weight = 'weight' in style ? style.weight : 1 + var width = 'width' in style ? style.width : 1 - return '' + return '' } OverpassLayer.twig.extendFunction('markerLine', markerLine)