mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Replace mph.json file with country-coder implementation (re: #6941)
This commit is contained in:
@@ -10,7 +10,6 @@ export { dataShortcuts } from './shortcuts.json';
|
||||
export { dataTerritoryLanguages } from './territory-languages.json';
|
||||
|
||||
export { default as dataImperial } from './imperial.json';
|
||||
export { default as dataMPH } from './mph.json';
|
||||
export { default as dataDriveLeft } from './drive-left.json';
|
||||
export { en as dataEn } from '../dist/locales/en.json';
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,7 @@
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
import { select as d3_select } from 'd3-selection';
|
||||
import * as countryCoder from 'country-coder';
|
||||
|
||||
import { dataMPH } from '../../../data';
|
||||
import { geoPointInPolygon } from '../../geo';
|
||||
import { uiCombobox } from '../combobox';
|
||||
import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util';
|
||||
|
||||
@@ -57,11 +56,7 @@ export function uiFieldMaxspeed(field, context) {
|
||||
loc = childNodes[~~(childNodes.length/2)].loc;
|
||||
}
|
||||
|
||||
_isImperial = dataMPH.features.some(function(f) {
|
||||
return f.geometry.coordinates.some(function(d) {
|
||||
return geoPointInPolygon(loc, d);
|
||||
});
|
||||
});
|
||||
_isImperial = countryCoder.roadSpeedUnit(loc) === 'mph';
|
||||
|
||||
unitInput = wrap.selectAll('input.maxspeed-unit')
|
||||
.data([0]);
|
||||
|
||||
Reference in New Issue
Block a user