mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 00:29:50 +02:00
Expand DMS format and fix sec rounding logic (#10066)
Most DMS format parsed by @mapbox/sexagesimal, add a expandable matcher and two new formats for coordinates in DMS format in search bar example: `35 11 10.1 , 136 49 53.8` (D M SS format), or `35 11.168 , 136 49.896` (D MM format)
This commit is contained in:
@@ -5,7 +5,7 @@ import * as sexagesimal from '@mapbox/sexagesimal';
|
||||
|
||||
import { presetManager } from '../presets';
|
||||
import { t } from '../core/localizer';
|
||||
import { dmsCoordinatePair } from '../util/units';
|
||||
import { dmsCoordinatePair, dmsMatcher } from '../util/units';
|
||||
import { coreGraph } from '../core/graph';
|
||||
import { geoSphericalDistance } from '../geo/geo';
|
||||
import { geoExtent } from '../geo';
|
||||
@@ -125,7 +125,7 @@ export function uiFeatureList(context) {
|
||||
|
||||
if (!q) return result;
|
||||
|
||||
var locationMatch = sexagesimal.pair(q.toUpperCase()) || q.match(/^(-?\d+\.?\d*)\s+(-?\d+\.?\d*)$/);
|
||||
var locationMatch = sexagesimal.pair(q.toUpperCase()) || dmsMatcher(q);
|
||||
|
||||
if (locationMatch) {
|
||||
var loc = [Number(locationMatch[0]), Number(locationMatch[1])];
|
||||
|
||||
Reference in New Issue
Block a user