don't try to label if centroid is undefined

fixes #1180
This commit is contained in:
Ansis Brammanis
2013-03-28 15:26:38 -04:00
parent 37019b9912
commit 09642b1ea7

View File

@@ -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),