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

Indoor mode #3097

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
aa11306
indoor: ui-control attempts
zbycz Mar 26, 2016
24cfd5e
indoor: ui-control works, needs refactor
zbycz Apr 7, 2016
57bead6
indoor: ui-control refactoring
zbycz Apr 16, 2016
26c8a54
indoor: basic rendering
zbycz Apr 16, 2016
d67fafa
indoor: choose level of selected entitry
zbycz Apr 16, 2016
c9bf632
indoor: refactor event name
zbycz Apr 16, 2016
5fde1b6
indoor: hide building label-icons (added classes)
zbycz Apr 16, 2016
86a25e7
indoor: new objects with correct level
zbycz Apr 16, 2016
493147d
indoor: moved filter to features
zbycz Apr 16, 2016
757306a
indoor: fix build
zbycz Apr 16, 2016
c2a67fa
indoor: fix hiding building label
zbycz Apr 17, 2016
c1be9e2
indoor: better indoor-mode control with +-
zbycz Apr 18, 2016
ca7ed19
indoor: refactored filtering using features.indoor
zbycz Apr 18, 2016
439753c
indoor: fix showing relevant points
zbycz Apr 18, 2016
7f53f2b
indoor: fix default tags on new entities
zbycz Apr 18, 2016
bd8d92f
indoor: level=* without whitespace
zbycz Apr 18, 2016
5f96d62
indoor: hidden lower buildings then "current level"
zbycz Apr 18, 2016
3cd9ef3
indoor: hide surroundings for level < 0
zbycz Apr 19, 2016
04f19a1
indoor: supress losing selection when exiting indoor-mode
zbycz Apr 19, 2016
e4d5f58
indoor: level parameter in url
zbycz Apr 19, 2016
1fbad7f
indoor: hide "building" icon for amenity
zbycz Apr 19, 2016
aced1a4
indoor: fix - correct hiding of vertexes
zbycz Apr 21, 2016
f2c9118
indoor: mandatory level, optional repeat_on
zbycz Apr 22, 2016
dbee347
indoor: hide other buildings underground
zbycz Apr 22, 2016
1719fc2
indoor: translations
zbycz Apr 22, 2016
ddbd92a
indoor: styles for underground view
zbycz Apr 22, 2016
1309b18
indoor: inspector - indoor_levels field + ui.preset.range
zbycz Apr 22, 2016
507878d
indoor: refactoring context.indoor() to separate file
zbycz Apr 25, 2016
50d4d8d
indoor: show button when level=* feature in viewport
zbycz Apr 25, 2016
b5309d3
indoor: map redraw on event
zbycz Apr 25, 2016
ce1288f
indoor: eslint
zbycz Apr 25, 2016
6a8a3ad
indoor: refactoring + codestyle
zbycz Apr 25, 2016
4bacbdf
indoor: style changes from user testing
zbycz May 2, 2016
ce6de5c
indoor: add tests
zbycz May 3, 2016
3f1803b
indoor: fix decimal levels regexp + test
zbycz May 9, 2016
3f5097b
indoor: tagging - repeat_on means discreet values
zbycz May 9, 2016
a57c92e
indoor: refactor inRange() to indoor file
zbycz May 9, 2016
5edb261
indoor: switching floors using decimal values (if exist)
zbycz May 9, 2016
b37ccca
indoor: build english and presets
zbycz May 9, 2016
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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ dist/iD.js: \
js/id/renderer/background.js \
js/id/renderer/background_source.js \
js/id/renderer/features.js \
js/id/renderer/indoor.js \
js/id/renderer/map.js \
js/id/renderer/tile_layer.js \
js/id/svg.js \
Expand Down Expand Up @@ -196,6 +197,7 @@ dist/iD.js: \
js/id/ui/full_screen.js \
js/id/ui/geolocate.js \
js/id/ui/help.js \
js/id/ui/indoor_mode.js \
js/id/ui/info.js \
js/id/ui/inspector.js \
js/id/ui/intro.js \
Expand Down Expand Up @@ -237,6 +239,7 @@ dist/iD.js: \
js/id/ui/preset/localized.js \
js/id/ui/preset/maxspeed.js \
js/id/ui/preset/radio.js \
js/id/ui/preset/range.js \
js/id/ui/preset/restrictions.js \
js/id/ui/preset/textarea.js \
js/id/ui/preset/wikipedia.js \
Expand Down
26 changes: 26 additions & 0 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,29 @@ button.save.has-count .count::before {
border-right: 6px solid rgba(255,255,255,.5);
}

.indoormode-level-combo .combobox-input {
height: 40px;
border-radius: 4px 0 0 4px;
font-weight: bold;
text-align: center;
}
.indoormode-level-combo .combobox-input::-webkit-input-placeholder {
color: #000;
}
.indoormode-level-combo .combobox-caret {
display: none;
}
.indoormode-control .spin-control {
height: 40px;
width: 41.6666%; /* force .col5 */
border-right: 1px solid rgba(0,0,0,.5);
margin-left: 0;
background: white;
}
.indoormode-control .spin-control button {
border-right: 0;
}

/* Icons */

.icon {
Expand Down Expand Up @@ -1048,6 +1071,9 @@ button.save.has-count .count::before {
border-radius: 0 0 4px 4px;
overflow: hidden;
}
.form-field > input:nth-child(3) {
border-left: 0;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the ui.type.range needs second input without border.
Would you suggest a better selector maybe?


.form-field textarea {
height: 65px;
Expand Down
38 changes: 38 additions & 0 deletions css/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,44 @@ path.fill.tag-amenity-shelter {
}


/* Indoor features */
path.fill.tag-indoor {
display: none;
}
.indoor-mode path.fill.tag-building.tag-max_level {
clip-path: none !important;
stroke-width: 30px;
}
.indoor-mode path.way.area.stroke.tag-building.tag-max_level {
stroke-width: 6px;
}
.indoor-mode path.fill.tag-indoor {
display: block;
fill: rgba(169, 169, 169, 0.3);
stroke-width: 30px;
}
.indoor-mode path.stroke.tag-indoor {
stroke: rgb(169, 169, 169);
}
.indoor-mode path.stroke.tag-indoor-corridor {
opacity: 0.1;
}
.indoor-mode use.icon.areaicon.tag-building,
.indoor-mode use.icon.areaicon.tag-amenity,
.indoor-mode text.arealabel.tag-building,
.indoor-mode text.arealabel.tag-amenity,
.indoor-mode text.arealabel-halo.tag-building,
.indoor-mode text.arealabel-halo.tag-amenity {
display: none;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I`m not sure this is the right way to hide the building icon+label. It possibly breaks if other tags get precedence over building=* or amenity=* and shows its icon. Then it wouldnt be hidden.

Can you think of a better way, please? Or do you think its fine this way?

.indoor-mode .way:not(.tag-level):not(.tag-building) {
opacity: 0.1;
}
.indoor-mode.indoor-underground .way:not(.tag-level):not(.tag-building) {
opacity: 0.05;
}


/* Labels / Markers */

text {
Expand Down
10 changes: 10 additions & 0 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ en:
past_future:
description: Past/Future
tooltip: "Proposed, Construction, Abandoned, Demolished, etc."
indoor:
description: Indoor Features
tooltip: "All features with filled level."
indoor_different_level:
description: Indoor - hidden levels
tooltip: "When in indoor mode, it hides all levels except the selected one."
others:
description: Others
tooltip: "Everything Else"
Expand Down Expand Up @@ -367,6 +373,10 @@ en:
Another user changed some of the same map features you changed.
Click on each item below for more details about the conflict, and choose whether to keep
your changes or the other user's changes.
indoor_mode:
title: Indoor
help: Indoor mode helps you creating indoor objects by filtering only the selected level.
exit: Exit indoor editing mode.
merge_remote_changes:
conflict:
deleted: 'This object has been deleted by {user}.'
Expand Down
12 changes: 12 additions & 0 deletions data/presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,11 @@ en:
down: Down
# incline=up
up: Up
indoor_levels:
# 'min_level=*, max_level=*'
label: Indoor levels (min - max)
placeholder-0: '-1, 0, 1, 3...'
placeholder-1: '3, 5, 10...'
information:
# 'information=*'
label: Type
Expand Down Expand Up @@ -770,6 +775,9 @@ en:
religion:
# 'religion=*'
label: Religion
repeat_on:
# 'repeat_on=*'
label: Repeat on
restriction:
# 'restriction=*'
label: Type
Expand Down Expand Up @@ -2312,6 +2320,10 @@ en:
# historic=wayside_shrine
name: Wayside Shrine
terms: "<translate with synonyms or related terms for 'Wayside Shrine', separated by commas>"
indoor:
# 'indoor=*'
name: Indoor object
terms: "<translate with synonyms or related terms for 'Indoor object', separated by commas>"
junction:
# junction=yes
name: Junction
Expand Down
18 changes: 18 additions & 0 deletions data/presets/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,19 @@
}
}
},
"indoor_levels": {
"keys": [
"min_level",
"max_level"
],
"type": "range",
"label": "Indoor levels (min - max)",
"universal": true,
"strings": {
"placeholder-0": "-1, 0, 1, 3...",
"placeholder-1": "3, 5, 10..."
}
},
"information": {
"key": "information",
"type": "typeCombo",
Expand Down Expand Up @@ -1015,6 +1028,11 @@
"type": "combo",
"label": "Religion"
},
"repeat_on": {
"key": "repeat_on",
"type": "combo",
"label": "Repeat on"
},
"restriction": {
"key": "restriction",
"type": "combo",
Expand Down
13 changes: 13 additions & 0 deletions data/presets/fields/indoor_levels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"keys": [
"min_level",
"max_level"
],
"type": "range",
"label": "Indoor levels (min - max)",
"universal": true,
"strings": {
"placeholder-0": "-1, 0, 1, 3...",
"placeholder-1": "3, 5, 10..."
}
}
5 changes: 5 additions & 0 deletions data/presets/fields/repeat_on.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"key": "repeat_on",
"type": "combo",
"label": "Repeat on"
}
36 changes: 31 additions & 5 deletions data/presets/presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"area"
Expand Down Expand Up @@ -2642,6 +2643,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand Down Expand Up @@ -2749,7 +2751,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"area"
Expand Down Expand Up @@ -2780,6 +2783,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand Down Expand Up @@ -2861,6 +2865,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand All @@ -2876,7 +2881,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"area"
Expand All @@ -2892,6 +2898,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand Down Expand Up @@ -3011,7 +3018,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"area"
Expand All @@ -3034,7 +3042,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"point",
Expand Down Expand Up @@ -5111,6 +5120,23 @@
},
"name": "Wayside Shrine"
},
"indoor": {
"fields": [
"name",
"level",
"repeat_on"
],
"geometry": [
"point",
"area"
],
"tags": {
"indoor": "*"
},
"matchScore": 0.4,
"terms": [],
"name": "Indoor object"
},
"junction": {
"geometry": [
"vertex",
Expand Down
3 changes: 2 additions & 1 deletion data/presets/presets/building/college.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"area"
Expand Down
1 change: 1 addition & 0 deletions data/presets/presets/building/commercial.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand Down
3 changes: 2 additions & 1 deletion data/presets/presets/building/hospital.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"area"
Expand Down
1 change: 1 addition & 0 deletions data/presets/presets/building/hotel.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand Down
1 change: 1 addition & 0 deletions data/presets/presets/building/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand Down
1 change: 1 addition & 0 deletions data/presets/presets/building/retail.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"fields": [
"address",
"levels",
"indoor_levels",
"smoking"
],
"geometry": [
Expand Down
3 changes: 2 additions & 1 deletion data/presets/presets/building/school.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"area"
Expand Down
3 changes: 2 additions & 1 deletion data/presets/presets/building/train_station.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"icon": "building",
"fields": [
"address",
"levels"
"levels",
"indoor_levels"
],
"geometry": [
"point",
Expand Down
Loading