diff options
Diffstat (limited to 'perllib/FixMyStreet/Map/BingOL.pm')
-rw-r--r-- | perllib/FixMyStreet/Map/BingOL.pm | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/perllib/FixMyStreet/Map/BingOL.pm b/perllib/FixMyStreet/Map/BingOL.pm deleted file mode 100644 index 968642807..000000000 --- a/perllib/FixMyStreet/Map/BingOL.pm +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/perl -# -# FixMyStreet:Map::BingOL -# Bing maps on FixMyStreet, using OpenLayers. -# -# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved. -# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ - -package FixMyStreet::Map::BingOL; - -use strict; -use mySociety::Gaze; -use mySociety::Web qw(ent); - -sub header_js { - return ' -<!-- <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=en-GB"></script> --> -<script type="text/javascript" src="/jslib/OpenLayers-2.10/OpenLayers.js"></script> -<script type="text/javascript" src="/js/map-OpenLayers.js"></script> -<script type="text/javascript" src="/js/map-bing-ol.js"></script> -'; -} - -# 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 ($self, $q, %params) = @_; - $params{pre} ||= ''; - $params{post} ||= ''; - - my @pins; - foreach my $pin (@{$params{pins}}) { - $pin->[3] ||= ''; - push @pins, "[ $pin->[0], $pin->[1], '$pin->[2]', '$pin->[3]' ]"; - } - my $pins_js = join(",\n", @pins); - - my $out = FixMyStreet::Map::header($q, $params{type}); - my $copyright = _('Map contains Ordnance Survey data © Crown copyright and database right 2010. Microsoft'); - my $dist = mySociety::Gaze::get_radius_containing_population( $params{latitude}, $params{longitude}, 200_000 ); - my $zoom = 2; - $zoom = 3 if $dist < 10; - $out .= <<EOF; -<input type="hidden" name="latitude" id="fixmystreet.latitude" value="$params{latitude}"> -<input type="hidden" name="longitude" id="fixmystreet.longitude" value="$params{longitude}"> -<script type="text/javascript"> -var fixmystreet = { - 'latitude': $params{latitude}, - 'longitude': $params{longitude}, - 'zoom': $zoom, - 'pins': [ $pins_js ] -} -</script> -<div id="map_box"> - $params{pre} - <div id="map"></div> - <p id="copyright">$copyright</p> - $params{post} -</div> -<div id="side"> -EOF - return $out; -} - -1; |