aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-07-13 10:58:07 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-21 17:37:47 +0100
commitef9850616c71d82980bdf77e001267a89337e1a8 (patch)
tree22ea4291b7f374589ba75a173027704f5bc0b599 /perllib/FixMyStreet/DB/Result/Problem.pm
parent17ebb70ee0e1d0452b824d3d8daee7405f5edf5c (diff)
Refactor map pin/feature functions.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index bc72cf9da..2599f24ae 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -892,5 +892,18 @@ has get_cobrand_logged => (
},
);
+sub pin_data {
+ my ($self, $c, $page, %opts) = @_;
+ my $colour = $c->cobrand->pin_colour($self, $page);
+
+ {
+ latitude => $self->latitude,
+ longitude => $self->longitude,
+ colour => $colour,
+ id => $self->id,
+ title => $opts{private} ? $self->title : $self->title_safe,
+ problem => $self,
+ }
+}
1;