From 92c0661cf40f9a8e39613784703bb6b2b9ac8a49 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 26 Nov 2010 01:49:02 +0000 Subject: Some OpenLayers options, including StreetView and CycleMap, and putting tilma within OL. --- perllib/FixMyStreet/Map/OSM/StreetView.pm | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 perllib/FixMyStreet/Map/OSM/StreetView.pm (limited to 'perllib/FixMyStreet/Map/OSM/StreetView.pm') diff --git a/perllib/FixMyStreet/Map/OSM/StreetView.pm b/perllib/FixMyStreet/Map/OSM/StreetView.pm new file mode 100644 index 000000000..08f677d25 --- /dev/null +++ b/perllib/FixMyStreet/Map/OSM/StreetView.pm @@ -0,0 +1,70 @@ +#!/usr/bin/perl +# +# FixMyStreet:Map::OSM::StreetView +# OSM StreetView maps on FixMyStreet. +# +# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved. +# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ + +package FixMyStreet::Map; + +use strict; +use mySociety::Web qw(ent); + +sub header_js { + return ' + + + +'; +} + +# display_map Q PARAMS +# PARAMS include: +# EASTING, NORTHING for the centre point of the map +# TYPE is 1 if the map is clickable, 2 if clickable and has a form upload, +# 0 if not clickable +# PINS is array of pins to show, location and colour +# PRE/POST are HTML to show above/below map +sub display_map { + my ($q, %params) = @_; + $params{pre} ||= ''; + $params{post} ||= ''; + + foreach my $pin (@{$params{pins}}) { + } + + my $out = FixMyStreet::Map::header($q, $params{type}); + my $copyright = _('Map contains Ordnance Survey data © Crown copyright and database right 2010.'); + $out .= < +var fixmystreet = { + 'easting': $params{easting}, + 'northing': $params{northing} +} + +
+ $params{pre} +
+ + $params{post} +
+
+EOF + return $out; +} + +sub display_map_end { + my ($type) = @_; + my $out = '
'; + $out .= '' if ($type); + return $out; +} + +sub display_pin { +} + +sub map_pins { +} + +1; -- cgit v1.2.3