How to use the @ideditor/country-coder.roadSpeedUnit function in @ideditor/country-coder

To help you get started, we’ve selected a few @ideditor/country-coder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstreetmap / iD / modules / ui / fields / maxspeed.js View on Github external
.call(speedCombo)
            .merge(input);

        input
            .on('change', change)
            .on('blur', change);

        var loc;
        if (_entity.type === 'node') {
            loc = _entity.loc;
        } else {
            var childNodes = context.graph().childNodes(context.entity(_entity.id));
            loc = childNodes[~~(childNodes.length/2)].loc;
        }

        _isImperial = countryCoder.roadSpeedUnit(loc) === 'mph';

        unitInput = wrap.selectAll('input.maxspeed-unit')
            .data([0]);

        unitInput = unitInput.enter()
            .append('input')
            .attr('type', 'text')
            .attr('class', 'maxspeed-unit')
            .call(unitCombo)
            .merge(unitInput);

        unitInput
            .on('blur', changeUnits)
            .on('change', changeUnits);

@ideditor/country-coder

Convert longitude-latitude pairs to ISO 3166-1 codes quickly and locally

ISC
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis