Do not set NaN extent when there is no GPX

This commit is contained in:
Tom MacWright
2013-03-28 17:24:11 -04:00
parent d6d87741c7
commit 78ae9a3e16
+7 -2
View File
@@ -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' );