From 09642b1ea71ed51e9bdb273b5cacbb1bf554e2c6 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 28 Mar 2013 15:26:38 -0400 Subject: [PATCH] don't try to label if centroid is undefined fixes #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 623fe4e76..25b0fab73 100644 --- a/js/id/svg/labels.js +++ b/js/id/svg/labels.js @@ -408,7 +408,7 @@ iD.svg.Labels = function(projection, context) { entitywidth = projection(extent[1])[0] - projection(extent[0])[0], rect; - if (entitywidth < 20) return; + if (!centroid || entitywidth < 20) return; var iconX = centroid[0] - (iconSize/2), iconY = centroid[1] - (iconSize/2),