Improve map style and perf

This commit is contained in:
Tom MacWright
2012-10-28 12:56:47 -04:00
parent c61feeb154
commit 78efa5a8bc
2 changed files with 22 additions and 11 deletions

View File

@@ -65,10 +65,10 @@ circle.handle {
}
.area.landuse {
stroke: #444;
stroke-width:1;
fill: #444;
opacity:0.2;
stroke: #006B34;
stroke-width: 1;
fill: #189E59;
fill-opacity:0.2;
}
/* highways */
@@ -84,13 +84,13 @@ circle.handle {
.stroke.highway-tertiary,
.stroke.highway-tertiary_link {
stroke:#FEFECB;
stroke-width:4;
stroke-width:6;
}
.casing.highway-unclassified,
.casing.highway-tertiary,
.casing.highway-tertiary_link {
stroke-width:6;
stroke-width:8;
}
.stroke.highway-service {
@@ -123,7 +123,11 @@ circle.handle {
stroke-width:9;
}
.casing.highway-trunk, .casing.highway-trunk_link {
stroke-width:9;
}
.stroke.highway-trunk, .stroke.highway-trunk_link {
stroke-width:7;
stroke:#7FC97F;
}

View File

@@ -169,6 +169,12 @@ iD.Map = function(obj) {
return as - bs;
}
var class_stroke = classes('stroke'),
class_fill = classes('stroke'),
class_area = classes('area'),
class_marker = classes('marker'),
class_casing = classes('casing');
function drawVector() {
var all = connection.intersects(extent());
@@ -209,25 +215,26 @@ iD.Map = function(obj) {
.on('click', selectClick);
fills.attr('d', nodeline)
.attr('class', classes('area'));
.attr('class', class_area);
casings.enter().append('path');
casings.order()
.attr('d', nodeline)
.attr('class', classes('casing'));
.attr('class', class_casing);
strokes.enter().append('path')
.on('click', selectClick);
strokes.order()
.attr('d', nodeline)
.attr('class', classes('stroke'));
.attr('class', class_stroke);
markers.enter().append('image')
.attr('class', classes('marker'))
.attr('class', class_marker)
.on('click', selectClick)
.attr({ width: 16, height: 16 })
.attr('xlink:href', iD.markerimage);
.attr('xlink:href', iD.markerimage)
.call(dragbehavior);
markers
.attr('transform', function(d) {