mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-28 02:42:36 +02:00
More work on vertex drawing, add debug for touch targets
This commit is contained in:
+20
-15
@@ -21,12 +21,13 @@ export function svgDebug(projection, context) {
|
||||
}
|
||||
|
||||
function drawDebug(selection) {
|
||||
var showsTile = context.getDebug('tile'),
|
||||
showsCollision = context.getDebug('collision'),
|
||||
showsImagery = context.getDebug('imagery'),
|
||||
showsImperial = context.getDebug('imperial'),
|
||||
showsDriveLeft = context.getDebug('driveLeft'),
|
||||
path = d3_geoPath(projection);
|
||||
var showsTile = context.getDebug('tile');
|
||||
var showsCollision = context.getDebug('collision');
|
||||
var showsImagery = context.getDebug('imagery');
|
||||
var showsImperial = context.getDebug('imperial');
|
||||
var showsDriveLeft = context.getDebug('driveLeft');
|
||||
var showsTouchTargets = context.getDebug('target');
|
||||
var path = d3_geoPath(projection);
|
||||
|
||||
|
||||
var debugData = [];
|
||||
@@ -45,6 +46,9 @@ export function svgDebug(projection, context) {
|
||||
if (showsDriveLeft) {
|
||||
debugData.push({ class: 'green', label: 'driveLeft' });
|
||||
}
|
||||
if (showsTouchTargets) {
|
||||
debugData.push({ class: 'pink', label: 'touchTargets' });
|
||||
}
|
||||
|
||||
|
||||
var legend = d3_select('#content')
|
||||
@@ -84,14 +88,14 @@ export function svgDebug(projection, context) {
|
||||
.merge(layer);
|
||||
|
||||
|
||||
var extent = context.map().extent(),
|
||||
dataImagery = data.imagery || [],
|
||||
availableImagery = showsImagery && multipolygons(dataImagery.filter(function(source) {
|
||||
if (!source.polygon) return false;
|
||||
return source.polygon.some(function(polygon) {
|
||||
return geoPolygonIntersectsPolygon(polygon, extent, true);
|
||||
});
|
||||
}));
|
||||
var extent = context.map().extent();
|
||||
var dataImagery = data.imagery || [];
|
||||
var availableImagery = showsImagery && multipolygons(dataImagery.filter(function(source) {
|
||||
if (!source.polygon) return false;
|
||||
return source.polygon.some(function(polygon) {
|
||||
return geoPolygonIntersectsPolygon(polygon, extent, true);
|
||||
});
|
||||
}));
|
||||
|
||||
var imagery = layer.selectAll('path.debug-imagery')
|
||||
.data(showsImagery ? availableImagery : []);
|
||||
@@ -142,7 +146,8 @@ export function svgDebug(projection, context) {
|
||||
context.getDebug('collision') ||
|
||||
context.getDebug('imagery') ||
|
||||
context.getDebug('imperial') ||
|
||||
context.getDebug('driveLeft');
|
||||
context.getDebug('driveLeft') ||
|
||||
context.getDebug('target');
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user