Skip to content

Commit b15536c

Browse files
boldtrnkarussell
authored andcommitted
Use Leaflet.Heightgraph to show PathDetails (graphhopper#1569)
* Use Leaflet.Heightgraph to show PathDetails * Show height of speed for average_speed instead of elevation * Revert height as speed * use light green if no path details * Remove jQuery empty * Use the hosted version on npm and remove the old elevation library * Remove red lines from the map, graphhopper#1573
1 parent 4edf5ec commit b15536c

File tree

10 files changed

+369
-46338
lines changed

10 files changed

+369
-46338
lines changed

web/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@
2626
"dependencies": {
2727
"browserify": "16.2.0",
2828
"browserify-swap": "0.2.2",
29-
"d3": "3.5.17",
29+
"d3": "5.9.1",
3030
"jquery": "3.3.1",
3131
"leaflet": "1.3.1",
3232
"leaflet-contextmenu": "1.4.0",
3333
"leaflet-loading": "0.1.24",
3434
"moment": "2.22.1",
3535
"uglifyify": "5.0.0",
36-
"flatpickr": "4.4.6"
36+
"flatpickr": "4.4.6",
37+
"leaflet.heightgraph": "0.0.1"
3738
},
3839
"devDependencies": {
3940
"jasmine": "3.1.0",
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
.heightgraph-container {
2+
background-color: #FFF;
3+
border-radius: 10px;
4+
display: none;
5+
cursor: default;
6+
user-select: none;
7+
}
8+
9+
.heightgraph-toggle {
10+
cursor: pointer;
11+
box-shadow: 0 1px 7px rgba(0, 0, 0, .4);
12+
border-radius: 5px;
13+
width: 28px;
14+
height: 28px;
15+
background: #f8f8f9;
16+
display: block;
17+
}
18+
19+
.heightgraph-toggle-icon {
20+
background: url(images/area-chart.svg) no-repeat center center;
21+
background-size: 14px 14px;
22+
width: 26px;
23+
height: 26px;
24+
position: absolute;
25+
}
26+
27+
.heightgraph-close-icon {
28+
background: url(images/remove.svg) no-repeat center center;
29+
background-size: 14px 14px;
30+
width: 26px;
31+
height: 26px;
32+
position: absolute;
33+
right: 0;
34+
display: none;
35+
}
36+
37+
.border-top {
38+
stroke-width: 1;
39+
stroke: #999;
40+
fill: none;
41+
}
42+
43+
.legend-hover {
44+
cursor: pointer;
45+
}
46+
47+
.legend-text {
48+
fill: #000;
49+
font-size: 10px;
50+
cursor: pointer;
51+
}
52+
53+
.tick, .tick text {
54+
fill: #999;
55+
pointer-events: none;
56+
}
57+
58+
.axis .tick line {
59+
visibility: hidden;
60+
pointer-events: none;
61+
}
62+
63+
.axis path {
64+
stroke: black;
65+
fill: none;
66+
stroke-width: 2px;
67+
shape-rendering: crispEdges;
68+
stroke: lightgrey;
69+
pointer-events: none;
70+
}
71+
72+
.focus {
73+
display: none;
74+
font-size: 10px;
75+
fill: #000;
76+
pointer-events: none;
77+
}
78+
79+
.focus rect {
80+
fill: rgba(255, 255, 255, 0.8);
81+
stroke-width: 1px;
82+
stroke: #888;
83+
pointer-events: none;
84+
}
85+
86+
.focus text {
87+
font-size: 12px;
88+
}
89+
90+
.focusLine line {
91+
stroke-width: 1px;
92+
stroke: rgb(20, 20, 20);
93+
display: none;
94+
cursor: default;
95+
shape-rendering: crispEdges;
96+
}
97+
98+
.height-focus.label rect {
99+
fill: rgba(255, 255, 255, 0.5);
100+
stroke-width: 1px;
101+
stroke: #888;
102+
pointer-events: none;
103+
shape-rendering: crispEdges;
104+
}
105+
106+
.height-focus.line {
107+
stroke: rgb(20, 20, 20);
108+
stroke-width: 1px;
109+
shape-rendering: crispEdges;
110+
}
111+
112+
.height-focus.circle {
113+
stroke: #FFF;
114+
stroke-width: 1px;
115+
}
116+
117+
.grid .tick {
118+
pointer-events: none;
119+
}
120+
121+
.grid .tick line {
122+
stroke: #EEE;
123+
stroke-width: 1px;
124+
shape-rendering: crispEdges;
125+
}
126+
127+
.grid path {
128+
stroke-width: 0;
129+
pointer-events: none;
130+
}
131+
132+
.tspan {
133+
font-weight: bold;
134+
}
135+
136+
.select-symbol {
137+
cursor: pointer;
138+
}
139+
140+
.select-info {
141+
cursor: default;
142+
}
143+
144+
.lineSelection {
145+
cursor: move;
146+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

web/src/main/resources/assets/css/leaflet.elevation-0.0.4.css

Lines changed: 0 additions & 64 deletions
This file was deleted.

web/src/main/resources/assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
<title>Driving Directions - GraphHopper Maps</title>
2828
<meta name="description" content="A fast route planner for biking, hiking and more! Based on OpenStreetMap including elevation data. Try out for free!"/>
2929
<link rel="stylesheet" href="css/leaflet.css?v=1.3.1" />
30-
<link rel="stylesheet" href="css/leaflet.elevation-0.0.4.css" />
3130
<link rel="stylesheet" href="css/leaflet_numbered_markers.css" />
3231
<link rel="stylesheet" href="css/leaflet.contextmenu.css?v=1.4.0" />
3332
<link rel="stylesheet" href="css/leaflet.loading.css?v=0.1.24" />
3433
<link rel="stylesheet" href="css/ui-lightness/jquery-ui.min.css" />
34+
<link rel="stylesheet" href="css/L.Control.Heightgraph.css?v=0.0.1" />
3535
<link rel="stylesheet" href="css/flatpickr.min.css?v=4.4.6">
3636
<script type="text/javascript" src="js/main.js?v=0.11.2"></script>
3737
<link rel="stylesheet" type="text/css" href="css/style.css" />

web/src/main/resources/assets/js/lib/leaflet.elevation-0.0.4.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)