X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1c8fbe329dc85ae06599c20a9d385e3af396d380..f7733cd328772087dca1bb2847d1511569692fbe:/vendor/assets/iD/iD.js diff --git a/vendor/assets/iD/iD.js b/vendor/assets/iD/iD.js index 3ce4ca9be..ba3246b5f 100644 --- a/vendor/assets/iD/iD.js +++ b/vendor/assets/iD/iD.js @@ -40309,11 +40309,11 @@ return new osmNode({ id: uid, visible: typeof obj.visible === 'boolean' ? obj.visible : true, - version: obj.version.toString(), - changeset: obj.changeset.toString(), + version: obj.version && obj.version.toString(), + changeset: obj.changeset && obj.changeset.toString(), timestamp: obj.timestamp, user: obj.user, - uid: obj.uid.toString(), + uid: obj.uid && obj.uid.toString(), loc: [parseFloat(obj.lon), parseFloat(obj.lat)], tags: obj.tags }); @@ -40323,11 +40323,11 @@ return new osmWay({ id: uid, visible: typeof obj.visible === 'boolean' ? obj.visible : true, - version: obj.version.toString(), - changeset: obj.changeset.toString(), + version: obj.version && obj.version.toString(), + changeset: obj.changeset && obj.changeset.toString(), timestamp: obj.timestamp, user: obj.user, - uid: obj.uid.toString(), + uid: obj.uid && obj.uid.toString(), tags: obj.tags, nodes: getNodesJSON(obj) }); @@ -40337,11 +40337,11 @@ return new osmRelation({ id: uid, visible: typeof obj.visible === 'boolean' ? obj.visible : true, - version: obj.version.toString(), - changeset: obj.changeset.toString(), + version: obj.version && obj.version.toString(), + changeset: obj.changeset && obj.changeset.toString(), timestamp: obj.timestamp, user: obj.user, - uid: obj.uid.toString(), + uid: obj.uid && obj.uid.toString(), tags: obj.tags, members: getMembersJSON(obj) }); @@ -54819,6 +54819,8 @@ var loc = extent.center(); context.map().centerEase(loc); + // we could enter the mode multiple times, so reset follow for next time + _follow = false; } @@ -62435,7 +62437,7 @@ // Guess a type based on the tokens present in the template // (This is for 'custom' source, where we don't know) if (!source.type) { - if (/\{(proj|wkid|bbox)\}/.test(_template)) { + if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(_template)) { source.type = 'wms'; source.projection = 'EPSG:3857'; // guess } else if (/\{(x|y)\}/.test(_template)) { @@ -62482,23 +62484,30 @@ switch (key) { case 'width': case 'height': - return tileSize; + return tileSize; case 'proj': - return projection; + return projection; case 'wkid': - return projection.replace(/^EPSG:/, ''); + return projection.replace(/^EPSG:/, ''); case 'bbox': - return minXmaxY.x + ',' + maxXminY.y + ',' + maxXminY.x + ',' + minXmaxY.y; + // WMS 1.3 flips x/y for some coordinate systems including EPSG:4326 - #7557 + if (projection === 'EPSG:4326' && + // The CRS parameter implies version 1.3 (prior versions use SRS) + /VERSION=1.3|CRS={proj}/.test(source.template())) { + return maxXminY.y + ',' + minXmaxY.x + ',' + minXmaxY.y + ',' + maxXminY.x; + } else { + return minXmaxY.x + ',' + maxXminY.y + ',' + maxXminY.x + ',' + minXmaxY.y; + } case 'w': - return minXmaxY.x; + return minXmaxY.x; case 's': - return maxXminY.y; + return maxXminY.y; case 'n': - return maxXminY.x; + return maxXminY.x; case 'e': - return minXmaxY.y; + return minXmaxY.y; default: - return token; + return token; } }); @@ -76919,7 +76928,7 @@ point: _t('modes.add_point.title'), line: _t('modes.add_line.title'), area: _t('modes.add_area.title'), - note: _t('modes.add_note.title'), + note: _t('modes.add_note.label'), delete: _t('operations.delete.title'), move: _t('operations.move.title'), orthogonalize: _t('operations.orthogonalize.title'), @@ -89867,7 +89876,7 @@ _base = context.graph(); _coalesceChanges = false; - loadActivePresets(); + loadActivePresets(true); return entityEditor .modified(false); @@ -89881,7 +89890,7 @@ }; - function loadActivePresets() { + function loadActivePresets(isForNewSelection) { var graph = context.graph(); @@ -89903,11 +89912,14 @@ return _mainPresetIndex.item(pID); }); - // A "weak" preset doesn't set any tags. (e.g. "Address") - var weakPreset = _activePresets.length === 1 && - Object.keys(_activePresets[0].addTags || {}).length === 0; - // Don't replace a weak preset with a fallback preset (e.g. "Point") - if (weakPreset && matches.length === 1 && matches[0].isFallback()) { return; } + if (!isForNewSelection) { + // A "weak" preset doesn't set any tags. (e.g. "Address") + var weakPreset = _activePresets.length === 1 && + !_activePresets[0].isFallback() && + Object.keys(_activePresets[0].addTags || {}).length === 0; + // Don't replace a weak preset with a fallback preset (e.g. "Point") + if (weakPreset && matches.length === 1 && matches[0].isFallback()) { return; } + } entityEditor.presets(matches); } @@ -117386,10 +117398,14 @@ // some targets have default click events we don't want to override var isOkayTarget = event.composedPath().some(function(node) { - // clicking