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
This commit is contained in:
Martin Raifer
2015-08-26 09:47:07 +02:00
parent 3b7f3d50b5
commit 6707063a53
+1 -1
View File
@@ -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),