Commit Graph

49 Commits

Author SHA1 Message Date
Quincy Morgan
655c3a692c Enable dragging the map during feature move and selection without exiting the mode (close #8187) 2020-12-03 15:05:19 -05:00
Quincy Morgan
6d7ec5d14e Fix issue with snapping to ways/nodes when drawing 2020-10-26 15:54:25 -04:00
Quincy Morgan
21a49bbec8 Initial support for D3 v6.2.0 2020-10-06 15:08:39 -04:00
Quincy Morgan
717f9ae5b7 Fix prior commit and add additional safety checks 2020-05-28 14:12:11 -04:00
Quincy Morgan
1214b2d5dd Preview the draw segment upon pointerdown on touchscreens unless it becomes invalid
Block creation of invalid geometries due to connecting to invalid sibling segments or nodes on the drawn way on touchscreens
2020-05-28 13:50:51 -04:00
Quincy Morgan
d8443d28d5 Detect and ignore erroneous mouse-type pointermove events sent after pointerup events on iOS when drawing 2020-05-28 11:13:09 -04:00
Quincy Morgan
869a0c6b89 Make the draw modes reuse their behaviorDraw when re-entering
Move click-end-node-to-finish functionality from draw modes to behaviorDraw
Fix issue where the head node would get hover-highlighted when continuing from the end of a line
2020-05-22 15:05:35 -04:00
Quincy Morgan
7a3a84b7b2 Remove broken "tail" functionality (close #7560) 2020-05-07 10:26:50 -07:00
Quincy Morgan
60f7dc7c0b Replace presets property of context with singleton
Remove utilPreset
2020-04-01 13:08:45 -07:00
Quincy Morgan
5195d8d95b Don't use d3_mouse and cache client rect values as needed (close #7489) 2020-03-28 16:32:38 -07:00
Quincy Morgan
6087aae21f Remove map convenience functions of context 2020-03-22 10:57:17 -07:00
Quincy Morgan
fac613e1dc Remove context.childNodes function 2020-03-21 13:56:11 -07:00
Quincy Morgan
6ed66fb3ce Make drawing modes usable on touch devices 2020-03-06 15:17:11 -08:00
Quincy Morgan
f8f69a777a Replace inconsistently-supported dblclick events with custom handler on platforms supporting pointer events
Fix issue where double-tap-to-zoom would not be properly disabled when drawing on touch devices (close #2128)
Support adding nodes to ways with double-tap with on touch devices (close #2677)
Support double-tap-to-zoom with styluses on touch devices
Don't accept double click/tap events if the taps are far apart
Don't re-enter modeSelect when clicking the selected feature again
2020-03-06 12:46:26 -08:00
Quincy Morgan
83a51a4192 Use pointer events for node dragging and drawing (re: #5505)
Enable dragging nodes with touches and styluses (close #7415)
2020-03-05 15:18:39 -08:00
Quincy Morgan
6e0f5c6823 Allow adding vertex-only features from the serach-to-add field
Allow favoriting vertex presets
Don't allow adding vertex-only presets as points
Rename Other preset to Vertex
2019-03-04 17:38:08 -05:00
Quincy Morgan
b828ada0e2 Don't allow adding point-only features as vertices 2019-03-04 17:04:35 -05:00
Quincy Morgan
0e71ae7032 Fix lint warning 2019-02-25 11:40:26 -05:00
Quincy Morgan
ced652806b Fix an issue where some tagged nodes or existing vertices could not be snapped to (close #5942) 2019-02-25 08:54:30 -05:00
Quincy Morgan
0b86be7bcb Fix bug where highlight would not appear on the first target node when continuing drawing a way 2019-02-15 11:56:31 -05:00
Max Grossman
58e31bc45a initial update to draw modes and hover behavior
ref #5811
2019-02-01 17:34:40 -05:00
Bryan Housel
152022aec4 Use context.keybinding for keybindings that don't change
(closes #5487)
2018-11-13 20:57:21 -05:00
Bryan Housel
bb30cbf555 Move lib/d3.keybinding.js -> util/keybinding.js
almost none of the original d3 "plugin" code remains
2018-11-13 13:42:09 -05:00
Bryan Housel
2ffcec965a Don't snap notes to OSM elements
(closes #5191)
2018-11-12 17:23:38 -05:00
Thomas Hervey
bf9b19359a WIP drag note 2018-07-20 21:41:44 -04:00
Bryan Housel
24eba5c1b0 Preventing snapping at viewport edge also prevented finishing ways 2018-01-20 22:45:03 -05:00
Bryan Housel
f0a27bc1ec Simplify way segmentation and fix bug with adjacent segment type
(closes #4669)

Now instead of creating MultiLineString targets, we just create a bunch of
LineString targets.  This makes the code simpler, and anyway the entity is
still there in `properties` for drawing code to decide what to do with the target.

Incidentally, this change allows iD to support an extrusion operation.
(Because each way segment has its own unique GeoJSON target now)
2018-01-09 10:12:29 -05:00
Bryan Housel
6881205d43 All touch targets are GeoJSON now
This makes the code a bit more consistent and lets us avoid some
hacky and probably non-performant things:
- abusing CSS classes in the draw/drag datum functions (classed `.target`)
  (is this thing target? just check d.properties)
- regexing the id for `-nope$`
  (is this thing a nope target? just check d.properties)
- using context.hasEntity to get a the real entity
  (is this thing a real osmEntity? just check d.properties)
- fixes code like the restriction editor which uses fake ids for split ways
2018-01-01 22:37:10 -05:00
Bryan Housel
96afbbd785 Refactor vector math functions from geo.js to vector.js 2017-12-28 01:08:11 -05:00
Bryan Housel
5d9b051f84 Fix drag_node for touch targets and line snapping 2017-12-21 20:31:20 -05:00
Bryan Housel
f58349864c Add support for nope targets, line sub-segment targeting 2017-12-20 13:52:16 -05:00
Bryan Housel
7a8f50c74e More fixes for drawing/snapping, don't draw touch targets for activeIDs 2017-12-18 22:54:49 -05:00
Bryan Housel
18c97d52c8 Extract viewport nudging code from several places to geoViewportEdge 2017-12-18 09:50:17 -05:00
Bryan Housel
aa68b21d7a Add touch targets for line/area 2017-12-17 22:53:58 -05:00
Bryan Housel
5a4faa84a1 Fixed some of the point/vertex/midpoint snapping issues
Still working on snapping to lines/areas, and making sure drawing lines/areas
will complete
2017-12-16 01:33:12 -05:00
Bryan Housel
75d2c45fd6 Convert lodah-es and d3 to named imports for behaviors 2017-09-24 21:43:54 -04:00
Bryan Housel
4ee5d7334b Fix spacebar drawing and hover in Firefox - don't match active node
(closes #4016)
2017-05-08 01:37:38 -04:00
Bryan Housel
cd09f9dfee Prevent mouseup from turning into a click
Mouseup was turning into a click on whatever was the last thing clicked.
In this walkthrough, this would sometimes be the "Add Area" mode button,
which would re-enter the add area mode and throw away the user's drawing.
(I have no idea why.)
2017-05-07 22:44:42 -04:00
Bryan Housel
af31cf5eb5 Fix spacedraw drawing, make clicking less touchy
(closes #3986)

Root cause was the vertex shadow strokes were too big, esp on endpoints.
For normal lines 16px stroke width centers on the line, but for vertices
it extends beyond the vertex radius, stealing clicks.

Also switched some "globals" to module variables in draw.js
2017-04-26 16:37:15 -04:00
Bryan Housel
3102a4ae6a Rename all the things to include pseudonamespaces 2016-10-04 19:06:20 -04:00
Tom MacWright
ed135ce9ef Enable lib tests 2016-09-05 10:22:45 -04:00
Tom MacWright
2910eaddbb Fix point adding 2016-09-04 10:52:57 -04:00
Tom MacWright
947a1d9c1a Resolve lints 2016-09-03 19:08:03 -04:00
Tom MacWright
3af54610ca Refactor customEvent system to use d3.customEvent 2016-09-03 17:56:56 -04:00
Bryan Housel
a86f34b4ef Pacify eslint, get build and tests running again 2016-08-26 01:15:07 -04:00
Tom MacWright
cdb533fa84 Begin d3 v4 update 2016-08-21 15:19:27 -04:00
Kushan Joshi
39c82af158 Sort modules [eslint rule] 2016-07-06 12:12:08 +05:30
Kushan Joshi
0939983515 external modules for behavior 2016-06-22 12:34:43 +05:30
Kushan Joshi
14f0d95e94 modularize iD.behavior 2016-06-17 12:53:19 +05:30