mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 01:33:03 +00:00
Pan the map for features that intersect with both edges
This commit is contained in:
@@ -44,15 +44,20 @@ iD.modes.Select = function (entity) {
|
||||
.datum(entity)
|
||||
.call(inspector);
|
||||
|
||||
// Pan the map if the clicked feature intersects with the position
|
||||
// of the inspector
|
||||
var inspector_size = d3.select('.inspector-wrap').size(),
|
||||
map_size = mode.map.size(),
|
||||
entity_extent = entity.extent(mode.history.graph()),
|
||||
left_edge = map_size[0] - inspector_size[0];
|
||||
left_edge = map_size[0] - inspector_size[0],
|
||||
left = mode.map.projection(entity_extent[1])[0],
|
||||
right = mode.map.projection(entity_extent[0])[0];
|
||||
|
||||
var left = mode.map.projection(entity_extent[1])[0];
|
||||
var right = mode.map.projection(entity_extent[0])[0];
|
||||
|
||||
if (left > left_edge) mode.map.centerEase(entity_extent[0]);
|
||||
if (left > left_edge &&
|
||||
right > left_edge) mode.map.centerEase(
|
||||
iD.util.geo.interp(
|
||||
entity_extent[0],
|
||||
entity_extent[1], 0.5));
|
||||
|
||||
inspector.on('changeTags', function(d, tags) {
|
||||
mode.history.perform(
|
||||
|
||||
Reference in New Issue
Block a user