Add halo for area icons

(closes #3762)
This commit is contained in:
Bryan Housel
2017-01-15 01:10:28 +05:30
parent 04b9c08bff
commit afb51ab4bd
2 changed files with 18 additions and 8 deletions
+11 -2
View File
@@ -1375,10 +1375,19 @@ text.point {
font-size: 10px;
}
.icon.areaicon {
opacity: 0.7;
.icon.areaicon-halo {
opacity: 0.6;
stroke: #999;
stroke-width: 2px;
stroke-miterlimit: 1;
}
.icon.areaicon {
fill: #222;
opacity: 0.8;
}
/* Turns */
g.turn rect,
+7 -6
View File
@@ -183,7 +183,7 @@ export function svgLabels(projection, context) {
function drawAreaIcons(selection, entities, filter, classes, labels) {
var icons = selection.selectAll('use')
var icons = selection.selectAll('use.' + classes)
.filter(filter)
.data(entities, osmEntity.key);
@@ -192,9 +192,9 @@ export function svgLabels(projection, context) {
icons = icons.enter()
.append('use')
.attr('class', 'icon areaicon')
.attr('width', '18px')
.attr('height', '18px')
.attr('class', 'icon ' + classes)
.attr('width', '17px')
.attr('height', '17px')
.merge(icons);
icons
@@ -503,7 +503,7 @@ export function svgLabels(projection, context) {
if (isNaN(centroid[0]) || entitywidth < 20) return;
var iconSize = 18,
var iconSize = 20,
iconX = centroid[0] - (iconSize / 2),
iconY = centroid[1] - (iconSize / 2),
margin = 2,
@@ -592,7 +592,8 @@ export function svgLabels(projection, context) {
// areas
drawAreaLabels(label, labelled.area, filter, 'arealabel', positions.area);
drawAreaLabels(halo, labelled.area, filter, 'arealabel-halo', positions.area);
drawAreaIcons(label, labelled.area, filter, 'arealabel-icon', positions.area);
drawAreaIcons(label, labelled.area, filter, 'areaicon', positions.area);
drawAreaIcons(halo, labelled.area, filter, 'areaicon-halo', positions.area);
// debug
drawCollisionBoxes(label, rskipped, 'debug-skipped');