|
15361 | 15361 | "package.json"() { |
15362 | 15362 | package_default = { |
15363 | 15363 | name: "iD", |
15364 | | - version: "2.35.0", |
| 15364 | + version: "2.35.2", |
15365 | 15365 | description: "A friendly editor for OpenStreetMap", |
15366 | 15366 | main: "dist/iD.min.js", |
15367 | 15367 | repository: "github:openstreetmap/iD", |
@@ -31708,12 +31708,12 @@ |
31708 | 31708 | } |
31709 | 31709 | function _overwrite(args, t2) { |
31710 | 31710 | var previous = _stack[_index].graph; |
31711 | | - var actionResult = _act(args, t2); |
31712 | 31711 | if (_index > 0) { |
31713 | 31712 | _index--; |
31714 | 31713 | _stack.pop(); |
31715 | 31714 | } |
31716 | 31715 | _stack = _stack.slice(0, _index + 1); |
| 31716 | + var actionResult = _act(args, t2); |
31717 | 31717 | _stack.push(actionResult); |
31718 | 31718 | _index++; |
31719 | 31719 | return change(previous); |
@@ -58266,19 +58266,26 @@ Please report this to https://github.com/markedjs/marked.`, e3) { |
58266 | 58266 | var drawLayer = selection2.selectAll(".layer-osm.labels"); |
58267 | 58267 | var layers = drawLayer.selectAll(".labels-group.halo, .labels-group.label"); |
58268 | 58268 | layers.selectAll(".nolabel").classed("nolabel", false); |
58269 | | - var mouse = context.map().mouse(); |
58270 | | - var ids = []; |
58271 | | - var pad3, bbox2; |
58272 | | - if (mouse && context.mode().id !== "browse" && context.mode().id !== "select") { |
58273 | | - pad3 = 20; |
| 58269 | + const graph = context.graph(); |
| 58270 | + const mouse = context.map().mouse(); |
| 58271 | + let bbox2; |
| 58272 | + let hideIds = []; |
| 58273 | + if (mouse && context.mode().id !== "browse") { |
| 58274 | + const pad3 = 20; |
58274 | 58275 | bbox2 = { minX: mouse[0] - pad3, minY: mouse[1] - pad3, maxX: mouse[0] + pad3, maxY: mouse[1] + pad3 }; |
58275 | | - var nearMouse = _rdrawn.search(bbox2).map(function(entity) { |
58276 | | - return entity.id; |
58277 | | - }); |
58278 | | - ids.push.apply(ids, nearMouse); |
58279 | | - } |
58280 | | - ids = utilArrayDifference(ids, ((_b2 = (_a4 = context.mode()) == null ? void 0 : _a4.selectedIDs) == null ? void 0 : _b2.call(_a4)) || []); |
58281 | | - layers.selectAll(utilEntitySelector(ids)).classed("nolabel", true); |
| 58276 | + const nearMouse = _rdrawn.search(bbox2).map((entity) => entity.id).filter((id2) => context.mode().id !== "select" || // in select mode: hide labels of currently selected line(s) |
| 58277 | + // to still allow accessing midpoints |
| 58278 | + // https://github.com/openstreetmap/iD/issues/11220 |
| 58279 | + context.mode().selectedIDs().includes(id2) && graph.hasEntity(id2).geometry(graph) === "line"); |
| 58280 | + hideIds.push.apply(hideIds, nearMouse); |
| 58281 | + hideIds = utilArrayUniq(hideIds); |
| 58282 | + } |
| 58283 | + const selected = (((_b2 = (_a4 = context.mode()) == null ? void 0 : _a4.selectedIDs) == null ? void 0 : _b2.call(_a4)) || []).filter((id2) => { |
| 58284 | + var _a5; |
| 58285 | + return ((_a5 = graph.hasEntity(id2)) == null ? void 0 : _a5.geometry(graph)) !== "line"; |
| 58286 | + }); |
| 58287 | + hideIds = utilArrayDifference(hideIds, selected); |
| 58288 | + layers.selectAll(utilEntitySelector(hideIds)).classed("nolabel", true); |
58282 | 58289 | var debug2 = selection2.selectAll(".labels-group.debug"); |
58283 | 58290 | var gj = []; |
58284 | 58291 | if (context.getDebug("collision")) { |
@@ -74692,7 +74699,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tif |
74692 | 74699 | }; |
74693 | 74700 | var annotation = _t("operations.change_tags.annotation"); |
74694 | 74701 | if (_coalesceChanges) { |
74695 | | - context.overwrite(combinedAction, annotation); |
| 74702 | + context.replace(combinedAction, annotation); |
74696 | 74703 | } else { |
74697 | 74704 | context.perform(combinedAction, annotation); |
74698 | 74705 | } |
@@ -74735,7 +74742,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tif |
74735 | 74742 | }; |
74736 | 74743 | var annotation = _t("operations.change_tags.annotation"); |
74737 | 74744 | if (_coalesceChanges) { |
74738 | | - context.overwrite(combinedAction, annotation); |
| 74745 | + context.replace(combinedAction, annotation); |
74739 | 74746 | } else { |
74740 | 74747 | context.perform(combinedAction, annotation); |
74741 | 74748 | } |
@@ -82265,7 +82272,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tif |
82265 | 82272 | return actionChangeTags(entityID, currTags); |
82266 | 82273 | }).filter(Boolean); |
82267 | 82274 | if (!actions.length) return; |
82268 | | - context.overwrite( |
| 82275 | + context.replace( |
82269 | 82276 | function actionUpdateWikipediaTags(graph) { |
82270 | 82277 | actions.forEach(function(action) { |
82271 | 82278 | graph = action(graph); |
@@ -82495,7 +82502,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tif |
82495 | 82502 | return null; |
82496 | 82503 | }).filter(Boolean); |
82497 | 82504 | if (!actions.length) return; |
82498 | | - context.overwrite( |
| 82505 | + context.replace( |
82499 | 82506 | function actionUpdateWikidataTags(graph) { |
82500 | 82507 | actions.forEach(function(action) { |
82501 | 82508 | graph = action(graph); |
@@ -84427,22 +84434,24 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tif |
84427 | 84434 | var annotation = entityIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.move.annotation.feature", { n: entityIDs.length }); |
84428 | 84435 | var _prevGraph; |
84429 | 84436 | var _cache5; |
84430 | | - var _prevMouse; |
| 84437 | + var _prevMouseCoords; |
84431 | 84438 | var _nudgeInterval; |
84432 | 84439 | var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse"; |
84433 | 84440 | function doMove(nudge) { |
84434 | 84441 | nudge = nudge || [0, 0]; |
84435 | 84442 | let fn; |
84436 | 84443 | if (_prevGraph !== context.graph()) { |
84437 | 84444 | _cache5 = {}; |
84438 | | - _prevMouse = context.map().mouse(); |
| 84445 | + _prevMouseCoords = context.map().mouseCoordinates(); |
84439 | 84446 | fn = context.perform; |
84440 | 84447 | } else { |
84441 | | - fn = context.overwrite; |
| 84448 | + fn = context.replace; |
84442 | 84449 | } |
84443 | | - const currMouse = context.map().mouse(); |
84444 | | - const delta = geoVecSubtract(geoVecSubtract(currMouse, _prevMouse), nudge); |
84445 | | - _prevMouse = currMouse; |
| 84450 | + const currMouseCoords = context.map().mouseCoordinates(); |
| 84451 | + const currMouse = context.projection(currMouseCoords); |
| 84452 | + const prevMouse = context.projection(_prevMouseCoords); |
| 84453 | + const delta = geoVecSubtract(geoVecSubtract(currMouse, prevMouse), nudge); |
| 84454 | + _prevMouseCoords = currMouseCoords; |
84446 | 84455 | fn(actionMove(entityIDs, delta, context.projection, _cache5)); |
84447 | 84456 | _prevGraph = context.graph(); |
84448 | 84457 | } |
@@ -84488,7 +84497,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tif |
84488 | 84497 | context.enter(modeBrowse(context)); |
84489 | 84498 | } |
84490 | 84499 | mode.enter = function() { |
84491 | | - _prevMouse = context.map().mouse(); |
| 84500 | + _prevMouseCoords = context.map().mouseCoordinates(); |
84492 | 84501 | _prevGraph = null; |
84493 | 84502 | _cache5 = {}; |
84494 | 84503 | context.features().forceVisible(entityIDs); |
|
0 commit comments