reenter browse mode in editOff when zoom < 16 (#2263)

This commit is contained in:
Bryan Housel
2014-06-27 17:55:13 -04:00
parent 839b08aff7
commit a9d58fdf74
3 changed files with 16 additions and 2 deletions
+11 -2
View File
@@ -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();
+4
View File
@@ -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() {
+1
View File
@@ -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));
});