From 46b6086dcfa6176c995e60ff48fc8a009ff1a6dc Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sat, 29 Oct 2016 15:27:06 -0400 Subject: [PATCH] Update projection arg for d3.geoPath(), deprecate d3.geoClipExtent() --- modules/svg/debug.js | 2 +- modules/svg/gpx.js | 3 +-- modules/svg/labels.js | 4 ++-- modules/svg/one_way_segments.js | 2 +- modules/svg/path.js | 2 +- modules/ui/map_in_map.js | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/svg/debug.js b/modules/svg/debug.js index b55714f0f..82130238d 100644 --- a/modules/svg/debug.js +++ b/modules/svg/debug.js @@ -24,7 +24,7 @@ export function svgDebug(projection, context) { showsImagery = context.getDebug('imagery'), showsImperial = context.getDebug('imperial'), showsDriveLeft = context.getDebug('driveLeft'), - path = d3.geoPath().projection(projection); + path = d3.geoPath(projection); var debugData = []; diff --git a/modules/svg/gpx.js b/modules/svg/gpx.js index 10afc9dcb..585b6515b 100644 --- a/modules/svg/gpx.js +++ b/modules/svg/gpx.js @@ -68,8 +68,7 @@ export function svgGpx(projection, context, dispatch) { .merge(paths); - var path = d3.geoPath() - .projection(projection); + var path = d3.geoPath(projection); paths .attr('d', path); diff --git a/modules/svg/labels.js b/modules/svg/labels.js index d1bf681e8..e4dc4c046 100644 --- a/modules/svg/labels.js +++ b/modules/svg/labels.js @@ -14,7 +14,7 @@ import { utilDisplayName, utilEntitySelector } from '../util/index'; export function svgLabels(projection, context) { - var path = d3.geoPath().projection(projection), + var path = d3.geoPath(projection), detected = utilDetect(), baselineHack = (detected.ie || detected.browser.toLowerCase() === 'edge'), rdrawn = rbush(), @@ -236,7 +236,7 @@ export function svgLabels(projection, context) { .merge(debugboxes); debugboxes - .attr('d', d3.geoPath().projection(null)); + .attr('d', d3.geoPath()); } } diff --git a/modules/svg/one_way_segments.js b/modules/svg/one_way_segments.js index e1568a620..5a7f0fde2 100644 --- a/modules/svg/one_way_segments.js +++ b/modules/svg/one_way_segments.js @@ -9,7 +9,7 @@ export function svgOneWaySegments(projection, graph, dt) { i = 0, offset = dt, segments = [], - clip = d3.geoClipExtent().extent(projection.clipExtent()).stream, + clip = d3.geoIdentity().clipExtent(projection.clipExtent()).stream, coordinates = graph.childNodes(entity).map(function(n) { return n.loc; }); diff --git a/modules/svg/path.js b/modules/svg/path.js index e6091ed9e..c79fa48fd 100644 --- a/modules/svg/path.js +++ b/modules/svg/path.js @@ -2,7 +2,7 @@ import * as d3 from 'd3'; export function svgPath(projection, graph, polygon) { var cache = {}, - clip = d3.geoClipExtent().extent(projection.clipExtent()).stream, + clip = d3.geoIdentity().clipExtent(projection.clipExtent()).stream, project = projection.stream, path = d3.geoPath() .projection({stream: function(output) { return polygon ? project(output) : project(clip(output)); }}); diff --git a/modules/ui/map_in_map.js b/modules/ui/map_in_map.js index b09f77bfc..f4e903e48 100644 --- a/modules/ui/map_in_map.js +++ b/modules/ui/map_in_map.js @@ -237,7 +237,7 @@ export function uiMapInMap(context) { // redraw viewport bounding box if (gesture !== 'pan') { - var getPath = d3.geoPath().projection(projection), + var getPath = d3.geoPath(projection), bbox = { type: 'Polygon', coordinates: [context.map().extent().polygon()] }; viewport = wrap.selectAll('.map-in-map-viewport')