mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 06:58:32 +02:00
When adding gpx, only rezoom map if gpx not in viewport (closes #2297)
This commit is contained in:
@@ -149,8 +149,11 @@ iD.Background = function(context) {
|
||||
|
||||
background.zoomToGpxLayer = function() {
|
||||
if (background.hasGpxLayer()) {
|
||||
context.map()
|
||||
.extent(d3.geo.bounds(gpxLayer.geojson()));
|
||||
var gpx = d3.geo.bounds(gpxLayer.geojson());
|
||||
|
||||
if (!context.map().extent().intersects(gpx)) {
|
||||
context.map().extent(gpx);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user