Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rendering direction on vertices (stop sign, traffic_signals, etc) #4602

Merged
merged 70 commits into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
b79b6ca
Support rendering `direction` on vertices (stop sign, traffic_signals…
bhousel Dec 7, 2017
6aba27c
Display directional vertex with a viewfield, not an arrow
bhousel Dec 8, 2017
515094c
Only add viewfields for an all-way stop on a highway intersection.
bhousel Dec 8, 2017
9c649b7
After switching from arrows to viewfields, forward/backward is different
bhousel Dec 8, 2017
42043b2
Support more tags, cardinal and numeric directions
bhousel Dec 8, 2017
34c98b9
Move directions code from vertices to node.js
bhousel Dec 9, 2017
2a8bf6c
Don't draw viewfields on hover, rearrange code
bhousel Dec 10, 2017
b42c096
Make sure viewfields actually update on update selection
bhousel Dec 10, 2017
8e19474
Render directional points (e.g. benches, cameras, signs) as vertices
bhousel Dec 11, 2017
ee3083b
Support rendering `camera:direction`
bhousel Dec 11, 2017
6b9ccdb
Add tests for osmNode#direction
bhousel Dec 11, 2017
2edbcc4
Match any `*:direction` key, rather than hardcoding a list
bhousel Dec 11, 2017
4b5260a
Add wireframe viewfield marker
bhousel Dec 11, 2017
a5bbc21
Remove unnecessary zoom parameter
bhousel Dec 11, 2017
b394cb6
Variable cleanup, elminiate lodash _filter
bhousel Dec 11, 2017
899abc7
WIP to render vertices while dragging
bhousel Dec 12, 2017
789f1e5
Make sure points/vertices render the right things at different zooms
bhousel Dec 13, 2017
5d5546d
Minor code formatting
bhousel Dec 13, 2017
450392d
Fix label placement for directional points rendered as vertices
bhousel Dec 13, 2017
006ee69
Avoid placing labels in interesting points/vertices
bhousel Dec 13, 2017
d9e3367
More improvements to label vertex avoidance
bhousel Dec 13, 2017
24baa53
Adjust some variable names to better match what they do
bhousel Dec 13, 2017
bfaf175
Move text to single group with subgroups for halo,label,debug
bhousel Dec 14, 2017
b9e48d1
WIP: Move layer-hit to layer-points with explict sublayers, update tests
bhousel Dec 14, 2017
ba5b3ee
More work on vertex drawing, add debug for touch targets
bhousel Dec 15, 2017
89d8d37
Drawing all the correct vertices now where I want them, simplify classes
bhousel Dec 15, 2017
f0e2d3f
Slightly adjust numbers for iconified vertices for better centering
bhousel Dec 15, 2017
6644c9d
Fix context.js and vertices.js tests
bhousel Dec 15, 2017
ba7437b
Fix order of vertex in _assign, always get latest entity
bhousel Dec 16, 2017
9d42d47
Touch targets can be keyed on entity.id instead of osmEntity.key
bhousel Dec 16, 2017
5cb5456
Implement touch targets for midpoints and points
bhousel Dec 16, 2017
5a4faa8
Fixed some of the point/vertex/midpoint snapping issues
bhousel Dec 16, 2017
5e99f3c
CSS pointer-events cleanup, also round linejoins
bhousel Dec 16, 2017
aa68b21
Add touch targets for line/area
bhousel Dec 18, 2017
57ba6a9
Add selectedIDs() for modeMove and modeRotate
bhousel Dec 18, 2017
b5eaa76
Optimization: when moving stuff around, don't exit/enter nodes
bhousel Dec 18, 2017
bcd5115
Fix extent in turn restrictions viewer, so vertices will render
bhousel Dec 18, 2017
18c97d5
Extract viewport nudging code from several places to geoViewportEdge
bhousel Dec 18, 2017
2e2b037
Move a bunch of commonly used vector and projection math functions in…
bhousel Dec 18, 2017
7155ef8
Fix double clicking on a way to create a vertex
bhousel Dec 18, 2017
eafc2b4
Adjust touch target radii
bhousel Dec 18, 2017
7a8f50c
More fixes for drawing/snapping, don't draw touch targets for activeIDs
bhousel Dec 19, 2017
563c496
Update selected vertices when drawing in select mode
bhousel Dec 19, 2017
7994baa
WIP: trying singular activeID and smarter target drawing code
bhousel Dec 19, 2017
f583498
Add support for nope targets, line sub-segment targeting
bhousel Dec 20, 2017
6d7659b
Refactor common helper code to svg/helpers.js, add area nopes
bhousel Dec 21, 2017
fcacdb4
Fix hover test (requires context.hasEntity stub)
bhousel Dec 21, 2017
d82d5dc
Add skipID to geoChooseEdge, to ignore dragging node
bhousel Dec 21, 2017
5d9b051
Fix drag_node for touch targets and line snapping
bhousel Dec 22, 2017
2be62ff
All the complicated code in drawWay can be removed
bhousel Dec 22, 2017
7851c49
Fix nopefilters by testing the original id for the filter
bhousel Dec 22, 2017
be00a52
Make sure all targets are redrawn during a mode change
bhousel Dec 22, 2017
fc68054
Don't dispatch drag start and move together
bhousel Dec 22, 2017
64a11f4
Restore ability to extend line at beginning or end
bhousel Dec 22, 2017
117ad7d
Transitionable actionMoveNode
bhousel Dec 22, 2017
d6e8ca2
Transitioned bouncebacks when user drags node onto a nope
bhousel Dec 23, 2017
9fbb4d3
Add geoVecEquals for strict comparisons
bhousel Dec 24, 2017
009d7b0
Add layer blocker and polygon self-intersection geometry check
bhousel Dec 24, 2017
ee61777
Snap to nope targets too (snapping is useful feedback)
bhousel Dec 26, 2017
fa7a6eb
Snap to nope line targets too, also remove svgBlocker, not needed
bhousel Dec 28, 2017
96afbbd
Refactor vector math functions from geo.js to vector.js
bhousel Dec 28, 2017
7af73c1
Refactor geometric math functions from geo.js to geom.js
bhousel Dec 28, 2017
462fef1
Remove unused imports (eslint warning)
bhousel Dec 29, 2017
4f02340
Extract self-intersection code to geoHasSelfIntersections
bhousel Dec 29, 2017
08cd2c7
Tests for geoHasSelfIntersections
bhousel Dec 29, 2017
35f8d56
Update direction fields and add to several presets
bhousel Dec 29, 2017
1bd41b8
Add direction tagging to intro graph for walkthrough
bhousel Dec 29, 2017
9c27893
Check for valid multipolygon geometry when dragging nodes
bhousel Dec 31, 2017
6881205
All touch targets are GeoJSON now
bhousel Jan 2, 2018
ddaa828
Handle both target GeoJSON and osmEntity in hover
bhousel Jan 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 47 additions & 55 deletions css/20_map.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@

use { pointer-events: none; }

/* base styles */
.layer-osm path:not(.oneway) { fill: none; } /* IE needs :not(.oneway) */

/* the above fill: none rule affects paths in <use> shadow dom only in Firefox */
.layer-osm use.icon path { fill: #333; } /* FF svg Maki icons */
.layer-osm .turn use path { fill: #000; } /* FF turn restriction icons */
#turn-only-shape2, #turn-only-u-shape2 { fill: #7092FF; } /* FF turn-only, turn-only-u */
#turn-no-shape2, #turn-no-u-shape2 { fill: #E06D5F; } /* FF turn-no, turn-no-u */
#turn-yes-shape2, #turn-yes-u-shape2 { fill: #8CD05F; } /* FF turn-yes, turn-yes-u */
#turn-only-shape2, #turn-only-u-shape2 { fill: #7092ff; } /* FF turn-only, turn-only-u */
#turn-no-shape2, #turn-no-u-shape2 { fill: #e06d5f; } /* FF turn-no, turn-no-u */
#turn-yes-shape2, #turn-yes-u-shape2 { fill: #8cd05f; } /* FF turn-yes, turn-yes-u */

g.point .shadow,
g.vertex .shadow,
g.midpoint .shadow {
pointer-events: all;

/* No interactivity except what we specifically allow */
.layer-osm * {
pointer-events: none;
}

path.shadow {
/* `.target` objects are interactive */
/* They can be picked up, clicked, hovered, or things can connect to them */
.node.target {
pointer-events: fill;
fill-opacity: 0.8;
fill: currentColor;
stroke: none;
}

.way.target {
pointer-events: stroke;
fill: none;
stroke-width: 12;
stroke-opacity: 0.8;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
}

/* `.target-nope` objects are explicitly forbidden to join to */
.node.target.target-nope,
.way.target.target-nope {
cursor: not-allowed;
}


/* `.active` objects (currently being drawn or dragged) are not interactive */
/* This is important to allow the events to drop through to whatever is */
/* below them on the map, so you can still hover and connect to other things. */
.layer-osm .active {
pointer-events: none !important;
}


/* points */

g.point .stroke {
Expand All @@ -45,10 +72,6 @@ g.point.selected .shadow {
stroke-opacity: 0.7;
}

g.point.active, g.point.active * {
pointer-events: none;
}

g.point ellipse.stroke {
display: none;
}
Expand Down Expand Up @@ -88,28 +111,6 @@ g.midpoint .shadow {
fill-opacity: 0;
}

g.vertex.vertex-hover {
display: none;
}

.mode-draw-area g.vertex.vertex-hover,
.mode-draw-line g.vertex.vertex-hover,
.mode-add-area g.vertex.vertex-hover,
.mode-add-line g.vertex.vertex-hover,
.mode-add-point g.vertex.vertex-hover,
.mode-drag-node g.vertex.vertex-hover {
display: block;
}

.mode-draw-area .hover-disabled g.vertex.vertex-hover,
.mode-draw-line .hover-disabled g.vertex.vertex-hover,
.mode-add-area .hover-disabled g.vertex.vertex-hover,
.mode-add-line .hover-disabled g.vertex.vertex-hover,
.mode-add-point .hover-disabled g.vertex.vertex-hover,
.mode-drag-node .hover-disabled g.vertex.vertex-hover {
display: none;
}

g.vertex.related:not(.selected) .shadow,
g.vertex.hover:not(.selected) .shadow,
g.midpoint.related:not(.selected) .shadow,
Expand All @@ -121,13 +122,6 @@ g.vertex.selected .shadow {
fill-opacity: 0.7;
}

.mode-draw-area g.midpoint,
.mode-draw-line g.midpoint,
.mode-add-area g.midpoint,
.mode-add-line g.midpoint,
.mode-add-point g.midpoint {
display: none;
}

/* lines */

Expand All @@ -138,7 +132,7 @@ g.vertex.selected .shadow {

path.line {
stroke-linecap: round;
stroke-linejoin: bevel;
stroke-linejoin: round;
}

path.stroke {
Expand Down Expand Up @@ -170,8 +164,7 @@ path.line.stroke {
/* Labels / Markers */

text {
font-size:10px;
pointer-events: none;
font-size: 10px;
color: #222;
opacity: 1;
}
Expand All @@ -180,11 +173,11 @@ text {
fill: #002F35;
}

path.oneway {
.onewaygroup path.oneway,
.viewfieldgroup path.viewfield {
stroke-width: 6px;
}


text.arealabel-halo,
text.linelabel-halo,
text.pointlabel-halo,
Expand All @@ -196,7 +189,6 @@ text.pointlabel {
font-size: 12px;
font-weight: bold;
fill: #333;
pointer-events: none;
-webkit-transition: opacity 100ms linear;
transition: opacity 100ms linear;
-moz-transition: opacity 100ms linear;
Expand All @@ -210,14 +202,14 @@ text.pointlabel {
dominant-baseline: auto;
}

.layer-halo text {
.layer-labels-halo text {
opacity: 0.7;
stroke: #fff;
stroke-width: 5px;
stroke-miterlimit: 1;
}

text.proximate {
text.nolabel {
opacity: 0;
}

Expand Down Expand Up @@ -247,8 +239,8 @@ g.turn circle {
}

.form-field-restrictions .vertex {
pointer-events: none;
cursor: auto !important;
pointer-events: none;
}

.lasso #map {
Expand All @@ -262,11 +254,11 @@ g.turn circle {
}

path.gpx {
stroke: #FF26D4;
stroke: #ff26d4;
stroke-width: 2;
fill: none;
}

text.gpx {
fill: #FF26D4;
fill: #ff26d4;
}
15 changes: 5 additions & 10 deletions css/55_cursors.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/* Cursors */

.nope,
.nope * {
cursor: not-allowed !important;
}

.map-in-map,
#map {
cursor: auto; /* Opera */
Expand Down Expand Up @@ -49,16 +54,6 @@
cursor: url(img/cursor-select-remove.png), pointer; /* FF */
}

#map .point:active,
#map .vertex:active,
#map .line:active,
#map .area:active,
#map .midpoint:active,
#map .mode-select .selected {
cursor: pointer; /* Opera */
cursor: url(img/cursor-select-acting.png), pointer; /* FF */
}

.mode-draw-line #map,
.mode-draw-area #map,
.mode-add-line #map,
Expand Down
26 changes: 3 additions & 23 deletions css/70_fills.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,9 @@
.fill-partial path.area.fill {
fill-opacity: 0;
stroke-width: 60px;
pointer-events: visibleStroke;
}

/* Modes */

.mode-draw-line .vertex.active,
.mode-draw-area .vertex.active,
.mode-drag-node .vertex.active {
display: none;
}

.mode-draw-line .way.active,
.mode-draw-area .way.active,
.mode-drag-node .active {
pointer-events: none;
}

/* Ensure drawing doesn't interact with area fills. */
.mode-add-point path.area.fill,
.mode-draw-line path.area.fill,
.mode-draw-area path.area.fill,
.mode-add-line path.area.fill,
.mode-add-area path.area.fill,
.mode-drag-node path.area.fill {
pointer-events: none;
.mode-browse .fill-partial path.area.fill,
.mode-select .fill-partial path.area.fill {
pointer-events: visibleStroke;
}
1 change: 1 addition & 0 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2864,6 +2864,7 @@ img.tile-removing {
stroke-width: 1;
}

.nocolor { color: rgba(0, 0, 0, 0); }
.red { color: rgba(255, 0, 0, 0.75); }
.green { color: rgba(0, 255, 0, 0.75); }
.blue { color: rgba(0, 0, 255, 0.75); }
Expand Down
Loading