diff options
author | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-03-26 00:05:15 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-03-26 00:05:15 +0000 |
commit | 7d77d31a628b2a06ae3600a1463e6d5bf8340778 (patch) | |
tree | 122290accd217ef4c05fffb78de71a07671e12bc | |
parent | 637a02b02f5b0e0254b49941477ad27ad25cd84b (diff) |
Move midpoint code to Cobrand, as I missed it hidden in map code.
-rw-r--r-- | perllib/Cobrand.pm | 2 | ||||
-rw-r--r-- | perllib/Cobrands/Barnet/Util.pm | 4 | ||||
-rw-r--r-- | perllib/Cobrands/Southampton/Util.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/Tilma/Original.pm | 4 |
4 files changed, 12 insertions, 2 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm index fa2dd9e88..b1ec6ba75 100644 --- a/perllib/Cobrand.pm +++ b/perllib/Cobrand.pm @@ -119,6 +119,8 @@ my %fns = ( # The MaPit types this site handles 'area_types' => { default => '[qw(DIS LBO MTD UTA CTY COI)]' }, 'area_min_generation' => { default => '10' }, + # Some cobrands that use a Tilma map have a smaller mid-point to make pin centred + 'tilma_mid_point' => { default => '""' }, ); foreach (keys %fns) { diff --git a/perllib/Cobrands/Barnet/Util.pm b/perllib/Cobrands/Barnet/Util.pm index 0e5ddcf68..e4115c232 100644 --- a/perllib/Cobrands/Barnet/Util.pm +++ b/perllib/Cobrands/Barnet/Util.pm @@ -109,5 +109,9 @@ sub recent_photos { return Problems::recent_photos($num, $lat, $lon, $dist); } +sub tilma_mid_point { + return 189; +} + 1; diff --git a/perllib/Cobrands/Southampton/Util.pm b/perllib/Cobrands/Southampton/Util.pm index ee7d8e728..d29b53127 100644 --- a/perllib/Cobrands/Southampton/Util.pm +++ b/perllib/Cobrands/Southampton/Util.pm @@ -109,5 +109,9 @@ sub recent_photos { return Problems::recent_photos($num, $lat, $lon, $dist); } +sub tilma_mid_point { + return 189; +} + 1; diff --git a/perllib/FixMyStreet/Map/Tilma/Original.pm b/perllib/FixMyStreet/Map/Tilma/Original.pm index 2a64b5bbb..0af6ed277 100644 --- a/perllib/FixMyStreet/Map/Tilma/Original.pm +++ b/perllib/FixMyStreet/Map/Tilma/Original.pm @@ -45,8 +45,8 @@ sub display_map { $params{pre} ||= ''; $params{post} ||= ''; my $mid_point = TILE_WIDTH; # Map is 2 TILE_WIDTHs in size, square. - if ($q->{site} eq 'barnet') { # Map is c. 380px wide - $mid_point = 189; + if (my $mp = Cobrand::tilma_mid_point(Page::get_cobrand($q))) { + $mid_point = $mp; } # convert map center point to easting, northing |