1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
(function(){
if (!fixmystreet.maps) {
return;
}
var defaults = {
http_options: {
url: "https://tilma.mysociety.org/mapserver/hounslow",
params: {
SERVICE: "WFS",
VERSION: "1.1.0",
REQUEST: "GetFeature",
SRSNAME: "urn:ogc:def:crs:EPSG::27700"
}
},
asset_type: 'spot',
max_resolution: {
'hounslow': 0.5291677250021167,
'fixmystreet': 1.194328566789627
},
min_resolution: 0.00001,
asset_id_field: 'CentralAssetId',
attributes: {
central_asset_id: 'CentralAssetId',
asset_details: 'FeatureId'
},
geometryName: 'msGeometry',
srsName: "EPSG:27700",
strategy_class: OpenLayers.Strategy.FixMyStreet,
body: "Hounslow Borough Council"
};
fixmystreet.assets.add($.extend(true, {}, defaults, {
http_options: {
params: {
TYPENAME: "bins"
}
},
asset_category: "Litter Bins",
asset_item: 'bin'
}));
// Disabled for now as the data is quite out of date and causing problems
// sending reports.
// fixmystreet.assets.add($.extend(true, {}, defaults, {
// http_options: {
// params: {
// TYPENAME: "trees"
// }
// },
// asset_id_field: 'central_asset_id',
// attributes: {
// central_asset_id: 'central_asset_id',
// asset_details: 'asset_number'
// },
// asset_category: [
// "Tree Danger/Obstruction",
// "Branches overhanging",
// "Damage By Tree",
// "Dead/Dying/Diseased",
// "Dying or dangerous tree",
// "Empty tree Pit",
// "Fallen or leaning tree",
// "General Maintenance and pruning",
// "Illuminated Traffic signal obstructed by vegetation",
// "Traffic signal obstructed by vegetation",
// "Pest: Tree/Shrub",
// "Pests in trees and shrubs",
// "Tree Branches Overhanging",
// "Tree Maintenance",
// "Tree causing damage to property",
// "Tree obstructing street light",
// "Trees or shrubs blocking visibility",
// "Trees or shrubs causing obstruction of highway",
// "Trees"
// ],
// asset_item: 'tree'
// }));
fixmystreet.assets.add($.extend(true, {}, defaults, {
http_options: {
params: {
TYPENAME: "signs"
}
},
asset_category: [
"Sign Obstructed: Vegetation",
"Missing sign",
"Missing/ damaged traffic sign",
"Sign or road marking missing following works",
"Street nameplate damaged",
"Traffic Sign obstructed (vegetation)",
"Unlit sign knocked down"
],
asset_item: 'sign'
}));
// "We do not want to show gullies as an asset layer, until we are
// confident that the inventory is accurate."
// https://3.basecamp.com/4020879/buckets/10951425/todos/1780668464
// fixmystreet.assets.add($.extend(true, {}, defaults, {
// http_options: {
// params: {
// TYPENAME: "gulleys"
// }
// },
// asset_category: [
// "Bad smell",
// "Flooding",
// "Blocked gully",
// "Damaged/ cracked drain or man hole cover",
// "Missing drain or man hole cover"
// ],
// asset_item: 'gulley'
// }));
var streetlight_select = $.extend({
label: "${FeatureId}",
labelOutlineColor: "white",
labelOutlineWidth: 3,
labelYOffset: 65,
fontSize: '15px',
fontWeight: 'bold'
}, fixmystreet.assets.style_default_select.defaultStyle);
// The label for street light markers should be everything after the final
// '/' in the feature's FeatureId attribute.
// This seems to be the easiest way to perform custom processing
// on style attributes in OpenLayers...
var select_style = new OpenLayers.Style(streetlight_select);
select_style.createLiterals = function() {
var literals = Object.getPrototypeOf(this).createLiterals.apply(this, arguments);
if (literals.label && literals.label.split) {
literals.label = literals.label.split("/").slice(-1)[0];
}
return literals;
};
var streetlight_stylemap = new OpenLayers.StyleMap({
'default': fixmystreet.assets.style_default,
'select': select_style
});
var labeled_defaults = $.extend(true, {}, defaults, {
select_action: true,
stylemap: streetlight_stylemap,
feature_code: 'FeatureId',
actions: {
asset_found: function(asset) {
var id = asset.attributes[this.fixmystreet.feature_code] || '';
if (id !== '' && id.split) {
var code = id.split("/").slice(-1)[0];
$('.category_meta_message').html('You have selected column <b>' + code + '</b>');
} else {
$('.category_meta_message').html('You can pick a <b class="asset-spot">' + this.fixmystreet.asset_item + '</b> from the map »');
}
},
asset_not_found: function() {
$('.category_meta_message').html('You can pick a <b class="asset-spot">' + this.fixmystreet.asset_item + '</b> from the map »');
}
}
});
fixmystreet.assets.add($.extend(true, {}, labeled_defaults, {
http_options: {
params: {
TYPENAME: "lighting"
}
},
asset_category: [
"Damage to paintwork",
"Damage to paintwork/ column",
"Door Missing/ open",
"Lights too bright/ dull",
"New LED lights not working",
"New LED lights too bright",
"New LED lights too dull",
"Not coming on/ faulty",
"Street light leaning",
"Street light not working",
"Street light on during the day",
"Street light wiring exposed",
"Street lights on during the day",
"Unauthorised sign",
"Veg Obstructed: Street Light",
"Zebra crossing beacon fault"
],
asset_item: 'light'
}));
fixmystreet.assets.add($.extend(true, {}, defaults, {
http_options: {
params: {
TYPENAME: "streets"
}
},
max_resolution: {
'hounslow': 6.614596562526458,
'fixmystreet': 4.777314267158508
},
always_visible: true,
non_interactive: true,
usrn: {
attribute: 'SITE_CODE',
field: 'site_code'
},
stylemap: fixmystreet.assets.stylemap_invisible
}));
})();
|