mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Zoom-dependent styles, optimize difference algorithm.
This commit is contained in:
@@ -8,7 +8,7 @@ body {
|
||||
color:#222;
|
||||
/* text-rendering: optimizeLegibility; */
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
}
|
||||
}
|
||||
|
||||
#iD {
|
||||
height: 100%;
|
||||
|
||||
22
css/map.css
22
css/map.css
@@ -34,6 +34,28 @@ circle.fill {
|
||||
transform:scale(1, 1);
|
||||
}
|
||||
|
||||
svg[data-zoom="16"] g.vertex circle.stroke,
|
||||
svg[data-zoom="16"] g.vertex circle.fill {
|
||||
-webkit-transform:scale(0.6, 0.6);
|
||||
-moz-transform:scale(0.6, 0.6);
|
||||
transform:scale(0.6, 0.6);
|
||||
}
|
||||
|
||||
svg[data-zoom="17"] g.vertex circle.stroke,
|
||||
svg[data-zoom="17"] g.vertex circle.fill {
|
||||
-webkit-transform:scale(0.7, 0.7);
|
||||
-moz-transform:scale(0.7, 0.7);
|
||||
transform:scale(0.7, 0.7);
|
||||
}
|
||||
|
||||
svg[data-zoom="16"] path.casing.tag-highway {
|
||||
stroke-width:6;
|
||||
}
|
||||
|
||||
svg[data-zoom="16"] path.stroke.tag-highway {
|
||||
stroke-width:4;
|
||||
}
|
||||
|
||||
g.vertex circle.stroke {
|
||||
fill:#333;
|
||||
}
|
||||
|
||||
@@ -78,9 +78,14 @@ iD.Map = function() {
|
||||
var only = {};
|
||||
difference.forEach(function buildDifference(id) {
|
||||
only[id] = graph.fetch(id);
|
||||
graph.parentWays(id).forEach(function buildOnly(parent) {
|
||||
only[parent.id] = graph.fetch(parent.id);
|
||||
});
|
||||
if (typeof only[id].type === 'node') {
|
||||
graph.parentWays(id).forEach(function buildOnly(parent) {
|
||||
// Don't re-fetch parents
|
||||
if (only[parent.id] === undefined) {
|
||||
only[parent.id] = graph.fetch(parent.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
all = _.compact(_.values(only));
|
||||
filter = function(d) { return d.accuracy ? d.way in only : d.id in only; };
|
||||
@@ -317,6 +322,7 @@ iD.Map = function() {
|
||||
|
||||
function redraw(difference) {
|
||||
dispatch.move(map);
|
||||
surface.attr('data-zoom', ~~map.zoom());
|
||||
tilegroup.call(background);
|
||||
if (map.zoom() > 16) {
|
||||
connection.loadTiles(projection);
|
||||
|
||||
Reference in New Issue
Block a user