mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 22:03:37 +02:00
Make view extent include both local and remote versions of the change
This commit is contained in:
@@ -409,10 +409,15 @@ iD.Map = function(context) {
|
||||
}
|
||||
};
|
||||
|
||||
map.trimmedExtent = function() {
|
||||
var headerY = 60, footerY = 30, pad = 10;
|
||||
return new iD.geo.Extent(projection.invert([pad, dimensions[1] - footerY - pad]),
|
||||
projection.invert([dimensions[0] - pad, headerY + pad]));
|
||||
map.trimmedExtent = function(_) {
|
||||
if (!arguments.length) {
|
||||
var headerY = 60, footerY = 30, pad = 10;
|
||||
return new iD.geo.Extent(projection.invert([pad, dimensions[1] - footerY - pad]),
|
||||
projection.invert([dimensions[0] - pad, headerY + pad]));
|
||||
} else {
|
||||
var extent = iD.geo.Extent(_);
|
||||
map.centerZoom(extent.center(), map.trimmedExtentZoom(extent));
|
||||
}
|
||||
};
|
||||
|
||||
function calcZoom(extent, dim) {
|
||||
|
||||
+13
-3
@@ -198,17 +198,27 @@ iD.ui.Conflicts = function(context) {
|
||||
.selectAll('input')
|
||||
.property('checked', function(d) { return d === datum; });
|
||||
|
||||
var extent = iD.geo.Extent(),
|
||||
entity;
|
||||
|
||||
entity = context.graph().hasEntity(datum.id);
|
||||
if (entity) extent._extend(entity.extent(context.graph()));
|
||||
|
||||
datum.action();
|
||||
zoomToEntity(datum.id);
|
||||
|
||||
entity = context.graph().hasEntity(datum.id);
|
||||
if (entity) extent._extend(entity.extent(context.graph()));
|
||||
|
||||
zoomToEntity(datum.id, extent);
|
||||
}
|
||||
|
||||
function zoomToEntity(id) {
|
||||
function zoomToEntity(id, extent) {
|
||||
context.surface().selectAll('.hover')
|
||||
.classed('hover', false);
|
||||
|
||||
var entity = context.graph().hasEntity(id);
|
||||
if (entity) {
|
||||
context.map().zoomTo(entity);
|
||||
context.map().trimmedExtent(extent);
|
||||
context.surface().selectAll(
|
||||
iD.util.entityOrMemberSelector([entity.id], context.graph()))
|
||||
.classed('hover', true);
|
||||
|
||||
Reference in New Issue
Block a user