diff options
Diffstat (limited to 'perllib/FixMyStreet/MapIt.pm')
-rw-r--r-- | perllib/FixMyStreet/MapIt.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/MapIt.pm b/perllib/FixMyStreet/MapIt.pm new file mode 100644 index 000000000..d0a5f4760 --- /dev/null +++ b/perllib/FixMyStreet/MapIt.pm @@ -0,0 +1,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 $url ne 'area' && FixMyStreet->config('MAPIT_GENERATION'); + + return mySociety::MaPit::call($url, $params, %opts); +} + +1; |