aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/Cobrand/Lincolnshire.pm24
-rw-r--r--perllib/FixMyStreet/Map/Lincolnshire.pm21
2 files changed, 45 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Lincolnshire.pm b/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
index 1e88ec624..d86afd77b 100644
--- a/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Lincolnshire.pm
@@ -29,9 +29,31 @@ sub open311_config {
{ name => 'description',
value => $row->detail };
+ # Reports made via FMS.com or the app probably won't have a site code
+ # value because we don't display the adopted highways layer on those
+ # frontends. Instead we'll look up the closest asset from the WFS
+ # service at the point we're sending the report over Open311.
+ if (!$row->get_extra_field_value('site_code')) {
+ if (my $site_code = $self->lookup_site_code($row)) {
+ push @$extra,
+ { name => 'site_code',
+ value => $site_code };
+ }
+ }
+
$row->set_extra_fields(@$extra);
}
+sub lookup_site_code_config { {
+ buffer => 200, # metres
+ url => "https://tilma.mysociety.org/mapserver/lincs",
+ srsname => "urn:ogc:def:crs:EPSG::27700",
+ typename => "NSG",
+ property => "Site_Code",
+ accept_feature => sub { 1 }
+} }
+
+
sub categories_restriction {
my ($self, $rs) = @_;
# Lincolnshire is a two-tier council, but don't want to display
@@ -47,4 +69,6 @@ sub categories_restriction {
] } );
}
+sub map_type { 'Lincolnshire' }
+
1;
diff --git a/perllib/FixMyStreet/Map/Lincolnshire.pm b/perllib/FixMyStreet/Map/Lincolnshire.pm
new file mode 100644
index 000000000..7dbfe5d8e
--- /dev/null
+++ b/perllib/FixMyStreet/Map/Lincolnshire.pm
@@ -0,0 +1,21 @@
+# FixMyStreet:Map::Lincolnshire
+# More JavaScript, for street assets
+
+package FixMyStreet::Map::Lincolnshire;
+use base 'FixMyStreet::Map::FMS';
+
+use strict;
+
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.wfs.js',
+ '/vendor/OpenLayers.Projection.OrdnanceSurvey.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-bing-ol.js',
+ '/js/map-fms.js',
+ '/cobrands/fixmystreet-uk-councils/roadworks.js',
+ '/cobrands/fixmystreet/assets.js',
+ '/cobrands/lincolnshire/roadworks.js',
+ '/cobrands/lincolnshire/assets.js',
+] }
+
+1;