mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
Merge remote-tracking branch 'k-yle/custom-data-numbers-bug' into develop
This commit is contained in:
@@ -315,6 +315,21 @@ export function svgData(projection, context, dispatch) {
|
||||
}
|
||||
|
||||
|
||||
function stringifyGeojsonProperties(feature) {
|
||||
const properties = feature.properties;
|
||||
for (const key in properties) {
|
||||
const property = properties[key];
|
||||
if (typeof property === 'number' || typeof property === 'boolean' || Array.isArray(property)) {
|
||||
properties[key] = property.toString();
|
||||
} else if (property === null) {
|
||||
properties[key] = 'null';
|
||||
} else if (typeof property === 'object') {
|
||||
properties[key] = JSON.stringify(property);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
drawData.setFile = function(extension, data) {
|
||||
_template = null;
|
||||
_fileList = null;
|
||||
@@ -332,6 +347,11 @@ export function svgData(projection, context, dispatch) {
|
||||
case '.geojson':
|
||||
case '.json':
|
||||
gj = JSON.parse(data);
|
||||
if (gj.type === 'FeatureCollection') {
|
||||
gj.features.forEach(stringifyGeojsonProperties);
|
||||
} else if (gj.type === 'Feature') {
|
||||
stringifyGeojsonProperties(gj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import { t } from '../../core/localizer';
|
||||
import { utilArrayDifference, utilArrayIdentical } from '../../util/array';
|
||||
import { utilGetSetValue, utilNoAuto, utilRebind, utilTagDiff } from '../../util';
|
||||
|
||||
|
||||
export function uiSectionRawTagEditor(id, context) {
|
||||
|
||||
var section = uiSection(id, context)
|
||||
|
||||
Reference in New Issue
Block a user