Fix isMaki, reset sizes, remove unnecessary checks

This commit is contained in:
Ajith Ranka
2017-01-13 15:04:58 +05:30
parent 953ca7cfc6
commit 3379d5d9ba
2 changed files with 7 additions and 11 deletions
+4 -4
View File
@@ -46,10 +46,10 @@ export function svgPoints(projection, context) {
.call(markerPath, 'stroke');
enter.append('use')
.attr('transform', 'translate(-6, -20)')
.attr('transform', 'translate(-5, -19)')
.attr('class', 'icon')
.attr('width', '12px')
.attr('height', '12px');
.attr('width', '11px')
.attr('height', '11px');
groups = groups
.merge(enter)
@@ -63,7 +63,7 @@ export function svgPoints(projection, context) {
groups.select('.icon')
.attr('xlink:href', function(entity) {
var preset = context.presets().match(entity, graph);
return (preset && preset.icon) ? '#' + preset.icon + '-12' : '';
return (preset && preset.icon) ? '#' + preset.icon + '-11' : '';
});
};
}
+3 -7
View File
@@ -18,11 +18,7 @@ export function uiPresetIcon() {
p = preset.apply(this, arguments),
geom = geometry.apply(this, arguments),
picon = p.icon || (geom === 'line' ? 'other-line' : 'marker-stroked'),
isMaki = dataFeatureIcons.hasOwnProperty(picon + '-24');
if (picon === 'dentist') {
isMaki = true; // workaround for dentist icon missing in `maki-sprite.json`
}
isMaki = dataFeatureIcons.indexOf(picon) !== -1;
function tag_classes(p) {
var s = '';
@@ -78,8 +74,8 @@ export function uiPresetIcon() {
return 'icon ' + picon + tag_classes(p);
});
icon.selectAll('use') // workaround: maki parking-24 broken?
.attr('href', '#' + picon + (isMaki ? (picon === 'parking' ? '-18' : '-24') : ''));
icon.selectAll('use')
.attr('href', '#' + picon + (isMaki ? '-15' : ''));
}