mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
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:
+1
-1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user