Guard against Firefox bug around hidden elements. Fixes #328

This commit is contained in:
Tom MacWright
2013-01-07 16:23:43 -05:00
parent 15099ee517
commit 9695205e92
+6 -1
View File
@@ -338,7 +338,12 @@ iD.Map = function() {
}
map.mouseCoordinates = function() {
return projection.invert(d3.mouse(surface.node()));
try {
return projection.invert(d3.mouse(surface.node()));
} catch(e) {
// when called with hidden elements, d3.mouse() will throw
return [NaN, NaN];
}
};
map.dblclickEnable = function(_) {