diff --git a/css/app.css b/css/app.css index 3b72f55b8..9a21b970d 100644 --- a/css/app.css +++ b/css/app.css @@ -38,16 +38,79 @@ table th { text-align:left; } +path { + fill: none; +} + path.casing { - fill: transparent; - stroke: #ace; - stroke-width: 6; + stroke: #111; + stroke-width: 3; } path.stroke { - fill: transparent; - stroke: #5F8594; - stroke-width: 4; + stroke: #555; + stroke-width: 2; +} + +path.casing.natural { + display:none; +} + +path.stroke.railway-rail { + stroke: white; + stroke-width: 3; + stroke-dasharray: 12,12; +} + +path.stroke.railway-subway { + stroke: #444; + stroke-width: 3; + stroke-dasharray: 8,8; +} + +path.stroke.natural { + stroke: #ADD6A5; + fill: #ADD6A5; + stroke-width:1; + opacity:0.2; +} + +path.stroke.landuse { + stroke: #444; + stroke-width:1; + fill: #444; + opacity:0.2; +} + +path.stroke.highway-residential { + stroke:#E8E8E8; + stroke-width:3; +} + +path.stroke.highway-unclassified, +path.stroke.highway-tertiary { + stroke:#FEFECB; + stroke-width:3; +} + +path.stroke.highway-service { + stroke:#fff; + stroke-width:2; +} + +path.stroke.highway-motorway, +path.stroke.highway-motorway_link { + stroke:#809BC0; +} + +path.stroke.highway-trunk, +path.stroke.highway-trunk_link { + stroke:#7FC97F; +} + +path.stroke.waterway { + stroke: #10539a; + stroke-width: 3; } .help-pane { diff --git a/index.html b/index.html index f908fbc58..ef573aecd 100755 --- a/index.html +++ b/index.html @@ -111,10 +111,10 @@ Imagery © 2012sublayer) { - sub = collection.createGroup(); - this._moveToPosition(sub,i); - sub.sublayer=sublayer; - return sub; - } - } - sub = collection.createGroup().moveToFront(); - sub.sublayer=sublayer; - return sub; // dojox.gfx.Group - }, - createUI: function(e, stateClasses) { // summary: Create a UI (sprite) for an entity, assigning any specified state classes // (temporary attributes such as ':hover' or ':selected') diff --git a/js/iD/renderer/WayUI.js b/js/iD/renderer/WayUI.js index 6a4793c00..8bd54936d 100755 --- a/js/iD/renderer/WayUI.js +++ b/js/iD/renderer/WayUI.js @@ -15,27 +15,46 @@ iD.renderer.WayUI = function(entity, map) { }; iD.renderer.WayUI.prototype = { - getEnhancedTags: function() { - var tags = this.entity.tags; - if (this.entity.isClosed()) { tags[':area']='yes'; } - return tags; - }, + getEnhancedTags: function() { + var tags = this.entity.tags; + if (this.entity.isClosed()) { tags[':area']='yes'; } + return tags; + }, - draw: function() { - // summary: Draw the object and add hitzone sprites. - var way = this.entity, - maxwidth = 4, - i; + getClasses: function() { + var classes = []; + function clean(x) { + return x.indexOf(' ') === -1 && x.length < 30; + } + for (var k in this.entity.tags) { + var v = this.entity.tags[k]; + if (!clean(k) || !clean(v)) { + console.log(k, v); + continue; + } + classes.push(k + '-' + v); + classes.push(k); + classes.push(v); + } + return classes.join(' '); + }, - if (!way.nodes.length) { return; } + draw: function() { + // summary: Draw the object and add hitzone sprites. + var way = this.entity; - // Create tags and calculate styleList - var tags = this.getEnhancedTags(); + if (!way.nodes.length) { return; } + + // Create tags and calculate styleList + var tags = this.getEnhancedTags(); + var classes = this.getClasses(); if (!this.casing) { this.casing = this.map.layers[0].casing.append("path") .data([way.nodes]) - .attr('class', 'casing'); + .attr('class', function() { + return 'casing ' + classes; + }); } this.casing.attr("d", this.map.linegen); @@ -43,15 +62,17 @@ iD.renderer.WayUI.prototype = { if (!this.stroke) { this.stroke = this.map.layers[0].stroke.append("path") .data([way.nodes]) - .attr('class', 'stroke'); + .attr('class', function() { + return 'stroke ' + classes; + }); } this.stroke.attr("d", this.map.linegen); return this; - }, + }, - entityMouseEvent:function(event) { - this.inherited(arguments); - } + entityMouseEvent:function(event) { + this.inherited(arguments); + } };