From 78ae9a3e169697c12453e4d6d2fc66e4ca6ca0e9 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 28 Mar 2013 17:24:11 -0400 Subject: [PATCH] Do not set NaN extent when there is no GPX --- js/id/ui/background.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/id/ui/background.js b/js/id/ui/background.js index b00a6066e..959daa003 100644 --- a/js/id/ui/background.js +++ b/js/id/ui/background.js @@ -224,8 +224,13 @@ iD.ui.Background = function(context) { .on('click', function() { d3.event.preventDefault(); d3.event.stopPropagation(); - context.map() - .extent(d3.geo.bounds(context.map().layers[1].geojson())) + if (context.map().layers[1].geojson().type) { + context.map() + .extent(d3.geo.bounds(context + .map() + .layers[1] + .geojson())); + } }) .append('span') .attr('class', 'icon geocode' );