diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-10 14:56:00 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-10 14:56:00 +0100 |
commit | 391ca1c469d93bb2c4798cc15e56fc495b5e80dd (patch) | |
tree | 6bc90fae589de824095e668fbf510ef259935729 /perllib/FixMyStreet/Map/Tilma/OpenLayers.pm | |
parent | 7c96f8ec61d6eddc211f3f0e71cdb276c6a5f773 (diff) | |
parent | 860383f0de3287b0666d64a3ffff3db3a0f087ae (diff) |
Merge branch 'migrate_to_catalyst' into reportemptyhomes
Diffstat (limited to 'perllib/FixMyStreet/Map/Tilma/OpenLayers.pm')
-rw-r--r-- | perllib/FixMyStreet/Map/Tilma/OpenLayers.pm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Map/Tilma/OpenLayers.pm b/perllib/FixMyStreet/Map/Tilma/OpenLayers.pm new file mode 100644 index 000000000..31e9eb096 --- /dev/null +++ b/perllib/FixMyStreet/Map/Tilma/OpenLayers.pm @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# +# FixMyStreet:Map::Tilma::1_10k_OL +# Using tilma.mysociety.org with OpenLayers +# +# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved. +# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ + +package FixMyStreet::Map::Tilma::OpenLayers; + +use strict; + +sub TILE_WIDTH() { return $FixMyStreet::Map::map_class->tile_width; } +sub SCALE_FACTOR() { return $FixMyStreet::Map::map_class->scale_factor; } +sub TILE_TYPE() { return $FixMyStreet::Map::map_class->tile_type; } + +# display_map C PARAMS +# PARAMS include: +# latitude, longitude for the centre point of the map +# TYPE is 1 if the map is clickable, 0 otherwise. +# PINS is array of pins to show, location and colour +sub display_map { + my ($self, $c, %params) = @_; + $c->stash->{map} = { + %params, + type => 'tilma/openlayers', + tile_type => TILE_TYPE, + tilewidth => TILE_WIDTH, + watermark => $self->watermark(), + copyright => $self->copyright(), + maxResolution => SCALE_FACTOR / TILE_WIDTH, + }; +} + +1; |