Skip to content

Commit 09e09d7

Browse files
author
Jaime Scowcroft
committed
New car park map showing proposals
1 parent 535b51b commit 09e09d7

File tree

5 files changed

+292
-3
lines changed

5 files changed

+292
-3
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
3+
const BeEVPopup = (feature, layer) => {
4+
const content = `<div class="smbc-map__item">
5+
<div class="smbc-map__item__header__block">
6+
<i class="fab fa-product-hunt smbc-map__item__header__block__icon" aria-hidden="true"></i>
7+
<span class="smbc-map__item__header__block__title">Car Park</span>
8+
</div>
9+
<div class="smbc-map__item__body">
10+
<p>${feature.properties.name}</p>
11+
<p>Cost: ${feature.properties.charging_category}</p>
12+
<p>Postcode: ${feature.properties.post_code}</p>
13+
<p>Spaces: ${feature.properties.total_capacity}</p>
14+
15+
16+
</div>
17+
</div>`
18+
layer.bindPopup(content)
19+
}
20+
21+
export {
22+
23+
BeEVPopup
24+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
const carparksStyle = {
2+
radius: 8,
3+
color: '#ffffff',
4+
weight: 2,
5+
opacity: 1,
6+
fillColor: '#3182bd',
7+
fillOpacity: 0.5
8+
}
9+
function freeStyle(feature) {
10+
11+
return {
12+
13+
radius: 8,
14+
color: '#ffffff',
15+
weight: 1,
16+
opacity: 1,
17+
fillColor: '#2E6F40',
18+
fillOpacity: 0.7
19+
}
20+
}
21+
function proposedStyle(feature) {
22+
23+
return {
24+
25+
radius: 8,
26+
color: '#ffffff',
27+
weight: 1,
28+
opacity: 1,
29+
fillColor: '#ff4d00',
30+
fillOpacity: 0.7
31+
}
32+
}
33+
function existingStyle(feature) {
34+
35+
return {
36+
37+
radius: 6,
38+
color: '#ffffff',
39+
weight: 1,
40+
opacity: 1,
41+
fillColor: '#3182bd',
42+
fillOpacity: 0.5
43+
}
44+
}
45+
export {
46+
carparksStyle,
47+
freeStyle,
48+
proposedStyle,
49+
existingStyle
50+
}
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
import Leaflet from 'leaflet'
2+
import {carparksPopup, BeEVPopup} from './Popups'
3+
import {carparksStyle, freeStyle, proposedStyle, existingStyle} from './Styles'
4+
5+
6+
7+
const Configuration = {
8+
Map: {
9+
10+
},
11+
12+
Tiles: {
13+
Token: '3G26OzBg7XRROryDwG1o1CZRmIx66ulo'
14+
},
15+
LayerControlOptions: { keyGraphic: true, groupCheckboxes: true },
16+
17+
DynamicData:
18+
[
19+
/*{
20+
key: 'Car Parks',
21+
url: 'wms',
22+
layerOptions: {
23+
layers: 'highways:car_parks_points',
24+
minZoom: 2,
25+
popup: {
26+
icon: 'fab fa-product-hunt',
27+
body: {
28+
Name: 'name',
29+
Postcode: 'post_code',
30+
'RingGo Zone': 'ringgo_zone',
31+
Spaces: 'total_capacity',
32+
'Disabled Spaces': 'disabled_spaces',
33+
'Parent and Child Spaces': 'parent_child_spaces',
34+
'Electric Vehicle Spaces': 'electric_vehicle_spaces',
35+
'Height Restriction': 'height_restriction_m',
36+
'Park Mark': 'park_mark'
37+
}
38+
},
39+
},
40+
41+
},*/
42+
43+
{
44+
key: 'Free',
45+
url: 'wms',
46+
visibleByDefault: false,
47+
layerOptions: {
48+
layers: 'highways:car_park_points_free',
49+
minZoom: 2,
50+
popup: {
51+
icon: 'fab fa-product-hunt',
52+
body: {
53+
Name: 'name',
54+
Postcode: 'post_code',
55+
'RingGo Zone': 'ringgo_zone',
56+
Spaces: 'total_capacity',
57+
'Disabled Spaces': 'disabled_spaces',
58+
'Parent and Child Spaces': 'parent_child_spaces',
59+
'Electric Vehicle Spaces': 'electric_vehicle_spaces',
60+
'Height Restriction': 'height_restriction_m',
61+
'Park Mark': 'park_mark'
62+
}
63+
},
64+
},
65+
66+
},
67+
68+
{
69+
key: 'Proposed charge',
70+
url: 'wms',
71+
visibleByDefault: false,
72+
layerOptions: {
73+
layers: 'highways:car_park_points_proposed_fee',
74+
minZoom: 2,
75+
popup: {
76+
icon: 'fab fa-product-hunt',
77+
body: {
78+
Name: 'name',
79+
Postcode: 'post_code',
80+
'RingGo Zone': 'ringgo_zone',
81+
Spaces: 'total_capacity',
82+
'Disabled Spaces': 'disabled_spaces',
83+
'Parent and Child Spaces': 'parent_child_spaces',
84+
'Electric Vehicle Spaces': 'electric_vehicle_spaces',
85+
'Height Restriction': 'height_restriction_m',
86+
'Park Mark': 'park_mark'
87+
}
88+
},
89+
},
90+
91+
},
92+
93+
{
94+
key: 'Existing charge',
95+
url: 'wms',
96+
visibleByDefault: false,
97+
layerOptions: {
98+
layers: 'highways:car_park_points_charge',
99+
minZoom: 2,
100+
popup: {
101+
icon: 'fab fa-product-hunt',
102+
body: {
103+
Name: 'name',
104+
Postcode: 'post_code',
105+
'RingGo Zone': 'ringgo_zone',
106+
Spaces: 'total_capacity',
107+
'Disabled Spaces': 'disabled_spaces',
108+
'Parent and Child Spaces': 'parent_child_spaces',
109+
'Electric Vehicle Spaces': 'electric_vehicle_spaces',
110+
'Height Restriction': 'height_restriction_m',
111+
'Park Mark': 'park_mark'
112+
}
113+
},
114+
},
115+
116+
},
117+
118+
/*{
119+
key: 'Free',
120+
group: 'Parking cost',
121+
url: 'https://scnpostgres.stockport.gov.uk:8443/geoserver/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=highways:car_park_points_free&outputFormat=application/json&bbox={0},EPSG:4326&srsName=EPSG:4326',
122+
visibleByDefault: false,
123+
layerOptions: {
124+
onEachFeature: BeEVPopup,
125+
style: 'fill:#2E6F40',
126+
pointToLayer: (feature, latlng) => {
127+
const style = freeStyle(feature);
128+
return Leaflet.circleMarker(latlng, {
129+
color: style.color,
130+
weight: style.weight,
131+
opacity: style.opacity,
132+
fillColor: style.fillColor,
133+
fillOpacity: style.fillOpacity,
134+
radius: style.radius
135+
})
136+
}
137+
}
138+
},
139+
140+
{
141+
key: 'Proposed charge',
142+
group: 'Parking cost',
143+
url: 'https://scnpostgres.stockport.gov.uk:8443/geoserver/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=highways:car_park_points_proposed_fee&outputFormat=application/json&bbox={0},EPSG:4326&srsName=EPSG:4326',
144+
visibleByDefault: false,
145+
layerOptions: {
146+
onEachFeature: BeEVPopup,
147+
style: 'fill:#ff4d00',
148+
pointToLayer: (feature, latlng) => {
149+
const style = proposedStyle(feature);
150+
return Leaflet.circleMarker(latlng, {
151+
color: style.color,
152+
weight: style.weight,
153+
opacity: style.opacity,
154+
fillColor: style.fillColor,
155+
fillOpacity: style.fillOpacity,
156+
radius: style.radius
157+
})
158+
}
159+
}
160+
},
161+
162+
{
163+
key: 'Existing charge',
164+
group: 'Parking cost',
165+
url: 'https://scnpostgres.stockport.gov.uk:8443/geoserver/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=highways:car_park_points_charge&outputFormat=application/json&bbox={0},EPSG:4326&srsName=EPSG:4326',
166+
visibleByDefault: false,
167+
layerOptions: {
168+
onEachFeature: BeEVPopup,
169+
style: 'fill:#3182bd',
170+
pointToLayer: (feature, latlng) => {
171+
const style = existingStyle(feature);
172+
return Leaflet.circleMarker(latlng, {
173+
color: style.color,
174+
weight: style.weight,
175+
opacity: style.opacity,
176+
fillColor: style.fillColor,
177+
fillOpacity: style.fillOpacity,
178+
radius: style.radius
179+
})
180+
}
181+
}
182+
}
183+
184+
185+
/* {
186+
key: 'Car Parks - 2025',
187+
url: 'wms',
188+
visibleByDefault: false,
189+
layerOptions: {
190+
layers: 'highways:car_park_points_proposed',
191+
key: {align: 'below'},
192+
minZoom: 2,
193+
popup: {
194+
icon: 'fab fa-product-hunt',
195+
body: {
196+
Name: 'name',
197+
Price: 'charging_category',
198+
Postcode: 'post_code',
199+
'RingGo Zone': 'ringgo_zone',
200+
Spaces: 'total_capacity',
201+
'Disabled Spaces': 'disabled_spaces',
202+
'Parent and Child Spaces': 'parent_child_spaces',
203+
'Electric Vehicle Spaces': 'electric_vehicle_spaces',
204+
'Height Restriction': 'height_restriction_m',
205+
'Park Mark': 'park_mark'
206+
}
207+
},
208+
},
209+
210+
},*/
211+
212+
],
213+
}
214+
215+
export default Configuration

Configuration/car-parks/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const Configuration = {
3838
},
3939
},
4040

41-
},
42-
41+
}
42+
/*
4343
{
4444
key: 'Free',
4545
group: 'Parking cost',

webpack.dev.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
22
const path = require('path')
33
const { DefinePlugin } = require('webpack')
44

5-
const solution = 'neighbourhoods'
5+
const solution = 'car-parks-proposed'
66

77
module.exports = (env, argv, t) => (
88
{

0 commit comments

Comments
 (0)