95 Commits

Author SHA1 Message Date
Kyle Hensel
c3c0e23ba8 fix unsolvable validator error for presets with locationSet 2024-09-09 20:57:26 +10:00
Martin Raifer
b00a7e31ec don't consider traffic_calming features as areas
prerequisite for https://github.com/openstreetmap/id-tagging-schema/pull/1076
2024-01-24 13:48:29 +01:00
Martin Raifer
43784e2eff take entity loc into account when resolving fields via parent preset, fixes #9524
this necessary when a regional preset (e.g. from NSI) is supposed to inherit fields from a parent preset, but the direct parent does NOT apply at the location of the entity to be added/edited. In that case we need to search for a potential regional variant of the parent preset.
2023-05-25 19:19:09 +02:00
Martin Raifer
dc9b6a3acb only treat traffic_calming=island as an area tag
this is required for a proper fix of https://github.com/openstreetmap/id-tagging-schema/issues/733
2023-01-18 19:15:16 +01:00
Martin Raifer
5f1360ed0f don't suggest to "connect the ends" if a feature with area tags matches a line preset
For example, when a feature tagged as `highway=primary` (line preset) and `man_made=bridge` (area preset) is mapped as an unclosed way, converting it to an area (by closing the way by connecting the endpoints) does not improve the situation, as then the other tag doesn't fit to the geometry anymore.

closes #7037
2022-11-04 12:23:15 +01:00
Bryan Housel
2b2a71f597 Don't pre-resolve and index complex locationSets into GeoJSON.
This was taking a lot of time at app startup.

Instad now we resolve and index only the include and exclude parts.
We can still determine the valid locationSets at runtime in `locationSetsAt()`
by checking the `_locationIncludedIn` and `_locationExcludedIn` caches.

This also upgrades the locationManger to an ES6 class.

This also includes some hacky code in nsi.js so that the NSI will continue to work.
The NSI matcher can build its own location index, but it doesn't need to do this.
We monkeypatch a few of the matcher collections to work with the new LocationManager.
2022-10-28 10:49:01 -04:00
Martin Raifer
674421eec7 implement fetching string references
see https://github.com/openstreetmap/id-tagging-schema/pull/598
2022-10-07 12:04:23 +02:00
Martin Raifer
aee8258570 fix tests 2022-09-23 19:18:10 +02:00
Martin Raifer
e9eb0a0b3a include matching preset of selected object in preset selection list
see https://github.com/openstreetmap/iD/issues/9298#issuecomment-1250929094
2022-09-23 15:12:22 +02:00
Martin Raifer
4f34e28431 don't return hidden presets in recent 2022-09-23 15:07:56 +02:00
Martin Raifer
04a07092d2 Handle more "hybrid" area+line tags as area-by-default, fixes #8985 2022-02-16 15:56:28 +01:00
Milos Brzakovic (E-Search)
18f7e91b50 matchTags - improve indexing data structure 2021-10-25 12:10:20 +02:00
Milos Brzakovic (E-Search)
dee8cdfe07 matchTags- don't do locationsAt if locID is +Q2 2021-10-21 11:03:44 +02:00
Milos Brzakovic (E-Search)
599d2df19b matchTags - don't calculcate valid locations unless needed
mismatched_geometry - small optimization
2021-10-20 09:49:00 +02:00
Bryan Housel
ec787f81ad Location-aware preset matching 2021-03-23 12:39:14 -04:00
Bryan Housel
3cf5f69082 Allow missing locationSetID on presets, fields, categories
This simplifies the code a bit, just treat it as worldwide if missing
2021-03-12 12:27:50 -05:00
Bryan Housel
f95e7db8c9 Create the categories like the presets
The lack of locationSet was causing them to not show up, which indirectly
broke the tutorial at the step where user needs to pick the road category.
2021-03-12 12:04:52 -05:00
Bryan Housel
868db8819f Have mergeLocationSets work on Objects, add locationSetID property
This means less work for the other parts of the code,
now they don't need to chain that extra step after the promise.
2021-01-09 10:34:58 -05:00
Bryan Housel
271e1c2e19 Use locationManager to filter fields/presets/defaults 2021-01-08 16:06:57 -05:00
Bryan Housel
0ad7de0f10 Move the location index and resolver into a global coreLocations 2021-01-08 11:29:51 -05:00
Bryan Housel
9eb6f8781f Update presetIndex to resolve and index locationSets
Added a deferred work queue to do this with requestIdleCallback in the background
2021-01-06 16:26:12 -05:00
Quincy Morgan
dc8fd13586 Enable array-callback-return eslint rule 2020-10-23 13:47:09 -04:00
Quincy Morgan
cb6ab1405b Enable additional eslint rules, including no-unreachable-loop 2020-10-23 10:54:28 -04:00
Quincy Morgan
49526a7a67 Fix JS error upon changing addablePresetIDs after initial load
Accept addablePresetIDs as an array
Add code tests for invalid preset IDs in addablePresetIDs
2020-06-02 11:19:30 -04:00
Quincy Morgan
78a4b75e55 Fix regression where explicit addable presets were not populating the default preset list 2020-05-28 16:16:35 -04:00
Quincy Morgan
90b1395df4 Fix code tests 2020-04-01 13:27:30 -07:00
Quincy Morgan
60f7dc7c0b Replace presets property of context with singleton
Remove utilPreset
2020-04-01 13:08:45 -07:00
Quincy Morgan
527faa7b42 Remove need for coreContext in presetIndex 2020-04-01 11:25:45 -07:00
Quincy Morgan
a58abe3c6f Move localStorage interface from a property of coreContext to a corePreferences function 2020-04-01 11:00:48 -07:00
Quincy Morgan
a950b193d1 Fix preset categories 2020-03-31 16:41:46 -07:00
Quincy Morgan
a1af118f0e Ensure locales and presets are loaded before the UI loads (close #7406)
Consolidate localization behavior and init to a coreLocalizer function and singleton
Explicitly support `en-US` locale
Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext
Add `apiConnections` property of coreContext to simplify adding a source switcher
Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions
Make coreContext itself load the UI if a container has been specified at init time
Fix code tests
2020-03-31 12:23:31 -07:00
Bryan Housel
3608659d21 Restore field inheritance 2020-02-10 16:22:13 -05:00
Bryan Housel
2149692bee Make sure the addablePresetIDs can be reset back to null too 2020-02-07 12:55:16 -05:00
Bryan Housel
1155498766 Restore the addablePresetID feature 2020-02-07 12:06:59 -05:00
Bryan Housel
9faf8c0fe5 Test that fallback presets are there before data is loaded
Also, we don't actually need a vertex preset anymore, it was removed a while ago
2020-02-06 17:04:11 -05:00
Bryan Housel
3c6ba9703a presetIndex.build -> presetIndex.merge, and make it merge data 2020-02-05 21:13:15 -05:00
Bryan Housel
147af19626 Seed presetIndex collection with fallback presets
- amazingly, this passes all tests, but iD ends up pretty non-functional
2020-02-05 12:21:33 -05:00
Bryan Housel
e3e7cd3003 Memoize presetCollection.item (it's an Array.find)
Also add tests for `matchAllGeometry`
2020-02-05 10:32:20 -05:00
Bryan Housel
0fe766d9a4 WIP on external presets
- preset data is no longer bundled into iD.js
- some code pathways commented out re: external presets
- many changes so that tests can run without presets at start, or async
- still need to make sure fallbacks are always there (point, line, area, etc)
2020-02-05 09:38:26 -05:00
Quincy Morgan
41355bf2a0 Rename "visible" property of presets to "addable" (re: a06ec59514b30a52601e3614ef69006d2dc1bc91) 2020-01-15 14:29:45 -05:00
Quincy Morgan
f6769238ed Revert references to the v3 UI in the Keyboard Shortcuts menu
Remove unused preset favoriting functionality
2019-12-20 12:05:04 -05:00
Bryan Housel
6dfdec06ad Ignore junction in areaKeys code and remove the unsearchable presets
(closes #6933)

We should not be adding unsearchable junction presets for every kind of
junction as a hacky workaround to let `junction=yes` be an area.

This should remove the special treatment of junction tag.
* `junction=*` will not be treated as an area by default
* `junction=*` will not trigger validator warnings that they should be closed
* `junction=yes` mapped as an area _will_ need an `area=yes` now, which iD will add
(afaik this is the only junction tag that should be treated as an area)
2019-11-04 10:53:36 -05:00
Quincy Morgan
b1eaa2c29d Allow values in addTags to blacklist tags from implying a way should be an area (close #6800) 2019-09-19 09:06:42 -04:00
Quincy Morgan
3bf3ecf560 Populate the default preset list with the presets parameter values, if any (close #6703) 2019-07-31 16:18:10 -04:00
Quincy Morgan
2ad2bac931 Limit addable presets via comma-separated IDs in the presets URL parameter (close #6553) 2019-06-24 12:38:32 -04:00
Quincy Morgan
409968dfc2 Add index of tags that positively identify points or vertices, derived from the presets
Delete nodes that can only be vertices when deleting parent ways (close #6230)
Allow snapping ways to nodes that cannot be positively identified as vertex-only
2019-05-14 12:09:44 -04:00
Bryan Housel
e6bc9d9e8f Swap out d3-request, swap in d3-fetch 2019-04-24 16:25:25 -04:00
Bryan Housel
3896b2282f Remove lodash isNaN, isNumber, isString, bind, uniqBy
(re: 6087)
2019-03-27 23:11:45 -04:00
Quincy Morgan
53625a9364 Fix issues with the walkthrough 2019-03-27 17:41:15 -04:00
Bryan Housel
5b4aa529de Replace lodash uniq
(re: 6087)
2019-03-27 02:43:25 -04:00