76 Commits

Author SHA1 Message Date
Kyℓe Hensel
3b9b622294 fix wikidata styling not applying to vertices (#10258) 2024-06-05 12:53:42 +02:00
Martin Raifer
bd1836fd0c fix maki icons, tweak rendering of icons
* maki v7+ doesn't have provide "11px" icons anymore
* use 12px for icons on points & vertices on map (instead of 11px)
* use 12px for icons on QA tool (improveOSM, osmose) markers (instead of 13px)
* drop some unused code
2022-02-14 18:07:27 +01:00
Peter Newman
4205ca1d07 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.

(cherry picked from commit 2c47a11008)
2020-08-10 17:32:37 +01:00
Quincy Morgan
24b124e536 Fix infinite recursion error caused when rendering cyclical relations (close #7691) 2020-06-16 10:24:42 -04:00
Quincy Morgan
60f7dc7c0b Replace presets property of context with singleton
Remove utilPreset
2020-04-01 13:08:45 -07:00
Quincy Morgan
e391edcc5c Namespace various internal SVG ids under ideditor (re: #7445) 2020-03-22 14:39:40 -07:00
Quincy Morgan
912151ff38 Allow viewing and editing the tags/relations of selected features at any zoom level in 2.x (re: #5001) 2019-12-12 16:54:16 -05:00
Quincy Morgan
c5e1c0d596 Fix lint warning 2019-10-11 14:02:19 +02:00
Quincy Morgan
92116f198a Only show edited vertices as needed (close #6934) 2019-10-11 14:01:07 +02:00
Quincy Morgan
82acd82a29 Don't make edited vertex targets larger
Render vertex and point change highlight with some opacity
2019-10-10 18:58:39 +02:00
Quincy Morgan
c7186e2ee6 Replace usage of lodash isEqual (re: #6843) 2019-10-08 20:42:58 +02:00
Quincy Morgan
7d31c76546 Unify visual diff styles for lines and areas (re: #6843)
Render tag-only diffs in yellow instead of translucent orange
Don't use target colors for vertex diff styling
2019-10-08 20:25:09 +02:00
Quincy Morgan
f3e7bd9034 Render line and vertex visual diff on shadow instead of above everything (re: #6843)
Differentiate added lines and vertices from merely changed ones
2019-10-07 16:13:35 +02:00
Quincy Morgan
909079e454 Replace uses of lodash omit (re: #6843)
Fix lint warnings
2019-10-07 11:43:40 +02:00
Benjamin Clark
a0f85967b0 highlight edits now differentiates between tag edits and geometry edits for vertices/lines. 2019-09-11 13:02:12 -04:00
Benjamin Clark
a4dc7518c4 Add a hotkey to highlight edited ways. 2019-09-11 13:02:12 -04:00
Quincy Morgan
d01bb78707 Reduce circular dependencies caused by importing from indexes, the location of the validation models, and the location of areaKeys (close #6237) 2019-04-24 13:45:59 -07:00
Bryan Housel
11bfeaabfc Add browser-polyfills, remove lodash assign, compact, values
(re: #6087)
2019-03-22 17:14:41 -04:00
Bryan Housel
59795e41ab Don't style the active vertex in line drawing mode as a large endpoint
(closes #5711)
2019-01-14 17:30:20 -05:00
Bryan Housel
3bc841e95b Adjust layer ordering to draw touch targets above data layers 2018-11-09 21:48:45 -05:00
Bryan Housel
da10b6b254 Add maki- prefix to all maki icons
(re: #3924)
2018-06-05 22:12:33 -04:00
Bryan Housel
d6eb1b3f37 Make sure icons can be set on update, not just on enter
(closes #5045)
2018-05-30 18:10:37 -04:00
Bryan Housel
d00bdc69a5 Fix vertex hovering (targets are GeoJSON now) 2018-01-20 01:20:29 -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
99a21d1117 Render points as vertices at zoom >= 18 (was > 18)
(closes #4642)
2018-01-03 16:52: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
be00a526b6 Make sure all targets are redrawn during a mode change
There was an issue where the lines did not redraw their targets right away
when entering drag node, which could make it possible for a quick drag node
to try to connect to its parent line.  With the chooseEdge exclusion it
would not connect to the parent nearby, but in another weird part of the line.
2017-12-22 11:42:21 -05:00
Bryan Housel
7851c49e80 Fix nopefilters by testing the original id for the filter 2017-12-22 00:26:39 -05:00
Bryan Housel
6d7659b3bb Refactor common helper code to svg/helpers.js, add area nopes 2017-12-21 10:36:02 -05:00
Bryan Housel
f58349864c Add support for nope targets, line sub-segment targeting 2017-12-20 13:52:16 -05:00
Bryan Housel
7994baae23 WIP: trying singular activeID and smarter target drawing code
The goal here is that the code that draws the targets should know better
what parts of the lines/vertices are targetable, rather than just
relying on CSS to ignore the pointer events on the whole line.

e.g. when drawing a line, it's ok for it to loop back and connect
to itself, just not on a segment or vertex adjacent to the active
node.
2017-12-19 11:23:35 -05:00
Bryan Housel
563c496a65 Update selected vertices when drawing in select mode
This is a better solution to catching and drawing new verteices that
got added because a user double clicked on a line.
2017-12-19 09:08:59 -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
eafc2b4300 Adjust touch target radii 2017-12-18 17:00:47 -05:00
Bryan Housel
7155ef8bc6 Fix double clicking on a way to create a vertex 2017-12-18 16:09:07 -05:00
Bryan Housel
2e2b037e36 Move a bunch of commonly used vector and projection math functions into geo
- geoVecAdd
- geoVecSubtract
- geoVecScale
- geoZoomToScale
- geoScaleToZoom
2017-12-18 15:05:42 -05:00
Bryan Housel
b5eaa76d1a Optimization: when moving stuff around, don't exit/enter nodes
This avoids thrashing the DOM. The positions of the nodes will still
get updated by the update selection.
2017-12-18 00:13:16 -05:00
Bryan Housel
aa68b21d7a Add touch targets for line/area 2017-12-17 22:53:58 -05:00
Bryan Housel
5cb5456869 Implement touch targets for midpoints and points 2017-12-15 22:50:55 -05:00
Bryan Housel
9d42d470ca Touch targets can be keyed on entity.id instead of osmEntity.key
to avoid excessive exit/enter flickering
2017-12-15 21:26:58 -05:00
Bryan Housel
ba7437b4cc Fix order of vertex in _assign, always get latest entity
(selected or hovered entities are old, if we're moving vertices around)
2017-12-15 21:21:48 -05:00
Bryan Housel
f0e2d3fbfe Slightly adjust numbers for iconified vertices for better centering
(maybe not changed after we switched to maki2 which has 11px icons)
2017-12-15 17:50:00 -05:00
Bryan Housel
89d8d37576 Drawing all the correct vertices now where I want them, simplify classes
Some highlights
- `getSiblingAndChildVertices` are expensive, so they're saved and called less frequently
- draw touch targets for all the visible vertices
- remove redundant css classes and `setClass` function
2017-12-15 17:28:20 -05:00
Bryan Housel
ba5b3eee9c More work on vertex drawing, add debug for touch targets 2017-12-15 00:26:37 -05:00
Bryan Housel
b9e48d1682 WIP: Move layer-hit to layer-points with explict sublayers, update tests
This is more work to further isolate the layers that entities draw to.
It makes it easier to debug what is going on, and can eventually lead to
deferred drawing, if each draw function is in its own place and not dependant
on anything else.

I've started to replace the vertex-hover with an explicit layer for touch
targets.

Also had to change a lot of the svg tests, which are really brittle.
Things would happen like - the surface would be created, it would kick of a
deferred redraw, which would notice that the zoom was 0 and call
editOff, which would remove the osm layers that were just created and
that the tests were trying to draw to. These tests need proper zoom and
projection otherwise nothing works.
2017-12-14 17:38:43 -05:00
Bryan Housel
789f1e5f6f Make sure points/vertices render the right things at different zooms 2017-12-13 08:57:43 -05:00
Bryan Housel
899abc7ef5 WIP to render vertices while dragging
(re: #3003 / #4602)

For now, drawHover is commented out.  Still not sure what I will do with it.
This means that things flicker a bit when dragging, also connecting nodes
(and closing lines) does not currently work.

There was lot going on preventing the vertices from rendering while dragging.

1. `modeDragNode` needed a proper `selectedIDs()` function that works like other
modes.. Many other places in iD (including the vertex renderer) call `context.selectedIDs()`..
This means that `modeDragNode` needs a new function `restoreSelectedIDs()` to do what
`selectedIDs()` was previously doing (a place to store selectedIDs so that we
can reselect those entities after the user is done dragging a node in select mode)

2. Just so many things in svg/vertices.js
  - siblingAndChildVertices was missing some things for points that we render
    as vertices (points in wireframe, points with directions)
  - the sibling vertices weren't being included in the `filter` function, so
    would disappear when doing differenced/extent redraws
  - probably some other things
2017-12-12 17:39:36 -05:00
Bryan Housel
a5bbc21728 Remove unnecessary zoom parameter 2017-12-11 17:34:01 -05:00
Bryan Housel
4b5260a5ab Add wireframe viewfield marker
(styling marker fill in svg is not currently supported)
2017-12-11 15:48:08 -05:00
Bryan Housel
8e19474293 Render directional points (e.g. benches, cameras, signs) as vertices 2017-12-11 10:48:04 -05:00