mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 23:44:47 +02:00
reenter browse mode in editOff when zoom < 16 (#2263)
This commit is contained in:
+11
-2
@@ -187,8 +187,17 @@ iD.modes.Select = function(context, selectedIDs) {
|
||||
context.uninstall(behavior);
|
||||
});
|
||||
|
||||
var q = iD.util.stringQs(location.hash.substring(1));
|
||||
location.replace('#' + iD.util.qsString(_.omit(q, 'id'), true));
|
||||
var q = _.omit(iD.util.stringQs(location.hash.substring(1)), 'id'),
|
||||
center = context.map().center(),
|
||||
zoom = context.map().zoom(),
|
||||
precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2)),
|
||||
newhash = '#' + iD.util.qsString(_.assign(q, {
|
||||
map: zoom.toFixed(2) +
|
||||
'/' + center[0].toFixed(precision) +
|
||||
'/' + center[1].toFixed(precision)
|
||||
}), true);
|
||||
|
||||
location.replace(newhash);
|
||||
|
||||
keybinding.off();
|
||||
|
||||
|
||||
@@ -126,8 +126,12 @@ iD.Map = function(context) {
|
||||
}
|
||||
|
||||
function editOff() {
|
||||
var mode = context.mode();
|
||||
surface.selectAll('.layer *').remove();
|
||||
dispatch.drawn({full: true});
|
||||
if (!(mode && mode.id === 'browse')) {
|
||||
context.enter(iD.modes.Browse(context));
|
||||
}
|
||||
}
|
||||
|
||||
function zoomPan() {
|
||||
|
||||
@@ -11,6 +11,7 @@ describe("iD.modes.AddPoint", function() {
|
||||
.append('div')
|
||||
.attr('class', 'inspector-wrap');
|
||||
|
||||
context.map().centerZoom([-77.02271, 38.90085], 20);
|
||||
context.enter(iD.modes.AddPoint(context));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user