From 6707063a53629a9a57439ee1c03bd3ac01867710 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Wed, 26 Aug 2015 09:47:07 +0200 Subject: [PATCH] don't try to label if centroid is undefined updates fix from 09642b1e to updated d3 path.centroid return value structure (see https://github.com/mbostock/d3/commit/492215ad42e4b23bb713c012c449fa262007ec88#diff-fa5fbee10216651a004363cf56fb3602L43) fixes #2757 refs #1180 --- js/id/svg/labels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/id/svg/labels.js b/js/id/svg/labels.js index a76a96afd..b5e1cce05 100644 --- a/js/id/svg/labels.js +++ b/js/id/svg/labels.js @@ -371,7 +371,7 @@ iD.svg.Labels = function(projection, context) { entitywidth = projection(extent[1])[0] - projection(extent[0])[0], rect; - if (!centroid || entitywidth < 20) return; + if (isNaN(centroid[0]) || entitywidth < 20) return; var iconX = centroid[0] - (iconSize/2), iconY = centroid[1] - (iconSize/2),