aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm10
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm10
2 files changed, 15 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 9cc810c16..7dfda1a4c 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -590,7 +590,13 @@ sub inspect : Private {
sub map :Chained('id') :Args(0) {
my ($self, $c) = @_;
- my $image = $c->stash->{problem}->static_map;
+ my %params;
+ if ( $c->get_param('inline_duplicate') ) {
+ $params{full_size} = 1;
+ $params{zoom} = 5;
+ }
+
+ my $image = $c->stash->{problem}->static_map(%params);
$c->res->content_type($image->{content_type});
$c->res->body($image->{data});
}
@@ -639,7 +645,7 @@ sub _nearby_json :Private {
my $list_html = $c->render_fragment(
'report/nearby.html',
- { reports => $nearby }
+ { reports => $nearby, inline_maps => $c->get_param("inline_maps") ? 1 : 0 }
);
my $json = { pins => \@pins };
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index d9bb8e125..f10f1f7ec 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -1045,7 +1045,7 @@ sub pin_data {
};
sub static_map {
- my ($self) = @_;
+ my ($self, %params) = @_;
return unless $IM;
@@ -1053,7 +1053,11 @@ sub static_map {
unless $FixMyStreet::Map::map_class->isa("FixMyStreet::Map::OSM");
my $map_data = $FixMyStreet::Map::map_class->generate_map_data(
- { cobrand => $self->get_cobrand_logged },
+ {
+ cobrand => $self->get_cobrand_logged,
+ distance => 1, # prevents the call to Gaze which isn't necessary
+ $params{zoom} ? ( zoom => $params{zoom} ) : (),
+ },
latitude => $self->latitude,
longitude => $self->longitude,
pins => $self->used_map
@@ -1110,7 +1114,7 @@ sub static_map {
$image->Extent( geometry => '512x384', gravity => 'NorthWest');
$image->Extent( geometry => '512x320', gravity => 'SouthWest');
- $image->Scale( geometry => "310x200>" );
+ $image->Scale( geometry => "310x200>" ) unless $params{full_size};
my @blobs = $image->ImageToBlob(magick => 'jpeg');
undef $image;