Import osm-community-index and debug flag so we can look at it

This commit is contained in:
Bryan Housel
2018-04-03 22:44:52 -04:00
parent d60c423ac0
commit 242a01a3e1
5 changed files with 30 additions and 2 deletions
+1
View File
@@ -316,6 +316,7 @@ export function coreContext() {
tile: false, // tile boundaries
collision: false, // label collision bounding boxes
imagery: false, // imagery bounding polygons
community: false, // community bounding polygons
imperial: false, // imperial (not metric) bounding polygons
driveLeft: false, // driveLeft bounding polygons
target: false // touch targets
+18 -1
View File
@@ -1,3 +1,5 @@
import _values from 'lodash-es/values';
import { select as d3_select } from 'd3-selection';
import { geoPolygonIntersectsPolygon } from '../geo';
@@ -20,6 +22,7 @@ export function svgDebug(projection, context) {
var showsTile = context.getDebug('tile');
var showsCollision = context.getDebug('collision');
var showsImagery = context.getDebug('imagery');
var showsCommunity = context.getDebug('community');
var showsImperial = context.getDebug('imperial');
var showsDriveLeft = context.getDebug('driveLeft');
var showsTouchTargets = context.getDebug('target');
@@ -34,6 +37,9 @@ export function svgDebug(projection, context) {
if (showsImagery) {
debugData.push({ class: 'orange', label: 'imagery' });
}
if (showsCommunity) {
debugData.push({ class: 'blue', label: 'community' });
}
if (showsImperial) {
debugData.push({ class: 'cyan', label: 'imperial' });
}
@@ -71,7 +77,7 @@ export function svgDebug(projection, context) {
var layer = selection.selectAll('.layer-debug')
.data(showsImagery || showsImperial || showsDriveLeft ? [0] : []);
.data(showsImagery || showsCommunity || showsImperial || showsDriveLeft ? [0] : []);
layer.exit()
.remove();
@@ -102,6 +108,17 @@ export function svgDebug(projection, context) {
.attr('class', 'debug-imagery debug orange');
var community = layer.selectAll('path.debug-community')
.data(showsCommunity ? _values(data.community.features) : []);
community.exit()
.remove();
community.enter()
.append('path')
.attr('class', 'debug-community debug blue');
var imperial = layer
.selectAll('path.debug-imperial')
.data(showsImperial ? [dataImperial] : []);