Merge branch 'develop' into add_mapilio_data

This commit is contained in:
sezerbozbiyik
2023-07-21 14:40:58 +03:00
19 changed files with 319 additions and 279 deletions
+2 -4
View File
@@ -300,11 +300,9 @@ export default {
// Register viewer resize handler
context.ui().photoviewer.on('resize.kartaview', function(dimensions) {
imgZoom = d3_zoom()
imgZoom
.extent([[0, 0], dimensions])
.translateExtent([[0, 0], dimensions])
.scaleExtent([1, 15])
.on('zoom', zoomPan);
.translateExtent([[0, 0], dimensions]);
});
+5 -1
View File
@@ -204,7 +204,11 @@ export function uiField(context, presetField, entityIDs, options) {
referenceKey = referenceKey.replace(/:$/, '');
}
reference = uiTagReference(d.reference || { key: referenceKey }, context);
var referenceOptions = d.reference || {
key: referenceKey,
value: _tags[referenceKey]
};
reference = uiTagReference(referenceOptions, context);
if (_state === 'hover') {
reference.showing(false);
}
+2 -2
View File
@@ -46,13 +46,13 @@ export function uiFieldAddress(field, context) {
.map(d => {
let dist = geoSphericalDistance(d.extent(context.graph()).center(), l);
if (d.type === 'way') {
if (d.geometry(context.graph()) === 'line') {
var loc = context.projection([
(extent[0][0] + extent[1][0]) / 2,
(extent[0][1] + extent[1][1]) / 2
]);
var choice = geoChooseEdge(context.graph().childNodes(d), loc, context.projection);
dist = Math.min(dist, choice.distance);
dist = geoSphericalDistance(choice.loc, l);
}
const value = resultProp && d.tags[resultProp] ? d.tags[resultProp] : d.tags.name;
+1 -1
View File
@@ -483,7 +483,7 @@ export function uiFieldCombo(field, context) {
.attr('type', 'text')
.attr('id', field.domId)
.call(utilNoAuto)
.call(initCombo, selection)
.call(initCombo, _container)
.merge(_input);
if (_isSemi) {
+2 -1
View File
@@ -195,6 +195,7 @@ export function uiFieldText(field, context) {
window.open(url, '_blank');
}
})
.classed('disabled', () => !validIdentifierValueForLink())
.merge(outlinkButton);
} else if (field.type === 'url') {
input.attr('type', 'text');
@@ -375,7 +376,7 @@ export function uiFieldText(field, context) {
}
}
if (field.type === 'identifier' && field.pattern) {
return value && value.match(new RegExp(field.pattern))[0];
return value && value.match(new RegExp(field.pattern))?.[0];
}
return null;
}
+6
View File
@@ -1,3 +1,4 @@
import { marked } from 'marked';
import {
select as d3_select
} from 'd3-selection';
@@ -689,5 +690,10 @@ export function uiInit(context) {
_saveLoading = d3_select(null);
});
marked.use({
mangle: false,
headerIds: false,
});
return ui;
}
+9 -2
View File
@@ -92,7 +92,7 @@ export function uiPhotoviewer(context) {
target.style('height', newHeight + 'px');
}
dispatch.call(eventName, target, utilGetDimensions(target, true));
dispatch.call(eventName, target, subtractPadding(utilGetDimensions(target, true), target));
}
function clamp(num, min, max) {
@@ -151,9 +151,16 @@ export function uiPhotoviewer(context) {
.style('width', setPhotoDimensions[0] + 'px')
.style('height', setPhotoDimensions[1] + 'px');
dispatch.call('resize', photoviewer, setPhotoDimensions);
dispatch.call('resize', photoviewer, subtractPadding(setPhotoDimensions, photoviewer));
}
};
function subtractPadding(dimensions, selection) {
return [
dimensions[0] - parseFloat(selection.style('padding-left')) - parseFloat(selection.style('padding-right')),
dimensions[1] - parseFloat(selection.style('padding-top')) - parseFloat(selection.style('padding-bottom'))
];
}
return utilRebind(photoviewer, dispatch, 'on');
}
+2 -1
View File
@@ -1,4 +1,5 @@
import deepEqual from 'fast-deep-equal';
import { actionAddVertex } from '../actions/add_vertex';
import { actionChangeTags } from '../actions/change_tags';
import { actionMergeNodes } from '../actions/merge_nodes';
@@ -27,7 +28,7 @@ export function validationMismatchedGeometry() {
var asLine = presetManager.matchTags(tagSuggestingArea, 'line');
var asArea = presetManager.matchTags(tagSuggestingArea, 'area');
if (asLine && asArea && asLine === asArea) {
if (asLine && asArea && deepEqual(asLine.tags, asArea.tags)) {
// this tag also allows lines and making this an area wouldn't matter
return null;
}