aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/MapIt.pm
blob: 238c5c62c09afb3beb1373476b9857b7af32034d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package FixMyStreet::MapIt;

use FixMyStreet;
use mySociety::MaPit;

sub call {
    my ($url, $params, %opts) = @_;

    # 'area' always returns the ID you provide, no matter its generation, so no
    # point in specifying it for that. 'areas' similarly if given IDs, but we
    # might be looking up types or names, so might as well specify it then.
    $opts{generation} = FixMyStreet->config('MAPIT_GENERATION')
        if !$opts{generation} && $url ne 'area' && FixMyStreet->config('MAPIT_GENERATION');

    return mySociety::MaPit::call($url, $params, %opts);
}

1;