diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-09-08 15:39:51 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-09-08 15:39:51 +0100 |
commit | 2fe7ab388bc48ffc3458f2ae0d3b5721262e8c35 (patch) | |
tree | c905267cff119d1b517cea0cc514595c1ead6dc5 | |
parent | b35a27ba34dd96b829284bbd33d22abdb744c35f (diff) |
Move copyright on to map.
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/OSM/StreetView.pm | 1 | ||||
-rw-r--r-- | templates/web/default/maps/openlayers.html | 6 | ||||
-rw-r--r-- | templates/web/default/report/display.html | 7 | ||||
-rw-r--r-- | web/css/core.scss | 1 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 30 | ||||
-rw-r--r-- | web/js/map-streetview.js | 2 |
7 files changed, 35 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 2e40bfde3..d5edac763 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -21,7 +21,7 @@ sub map_template { } sub copyright { - return _('Map contains Ordnance Survey data © Crown copyright and database right 2010.<br>© 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Ordnance Survey.'); + return ''; } sub get_quadkey { diff --git a/perllib/FixMyStreet/Map/OSM/StreetView.pm b/perllib/FixMyStreet/Map/OSM/StreetView.pm index 141c2e328..8fe4744a4 100644 --- a/perllib/FixMyStreet/Map/OSM/StreetView.pm +++ b/perllib/FixMyStreet/Map/OSM/StreetView.pm @@ -24,7 +24,6 @@ sub base_tile_url { } sub copyright { - return _('Map contains Ordnance Survey data © Crown copyright and database right 2010.'); } 1; diff --git a/templates/web/default/maps/openlayers.html b/templates/web/default/maps/openlayers.html index 3cf615306..41e1c40d6 100644 --- a/templates/web/default/maps/openlayers.html +++ b/templates/web/default/maps/openlayers.html @@ -47,9 +47,9 @@ var fixmystreet = { <div id="pins">[% FOR pin IN map.pins %][% INCLUDE pin %][% END %]</div> [% INCLUDE compass %] </noscript></div> - <p id="copyright"> - [% map.copyright %] - </p> + [% IF map.copyright %] + <p id="copyright">[% map.copyright %]</p> + [% END %] [% BLOCK compass %] diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html index ae0404df8..9ce6be8ad 100644 --- a/templates/web/default/report/display.html +++ b/templates/web/default/report/display.html @@ -10,13 +10,6 @@ [% map_html %] -[% IF c.cobrand.country == 'GB' %] -<p id='sub_map_links'> - <a href="http://maps.google.co.uk/maps?output=embed&z=16&q= - [%- problem.title _ ' - ' _ c.cobrand.base_url_for_emails _ '/report/' _ problem.id | uri -%] -@[% short_latitude %],[% short_longitude %]">View on Google Maps</a></p> -[% END %] - </div> <div id="side"> diff --git a/web/css/core.scss b/web/css/core.scss index 6186f8965..17bf4e6c2 100644 --- a/web/css/core.scss +++ b/web/css/core.scss @@ -538,6 +538,7 @@ $map_width: 500px; .olControlAttribution { bottom: 3px !important; left: 3px; + color: #222222; } .olControlPermalink { bottom: 3px !important; diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 032ac1e89..391f837c6 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -4,14 +4,40 @@ function set_map_config(perm) { new OpenLayers.Control.ArgParser(), new OpenLayers.Control.Navigation(), perm, + //new OpenLayers.Control.ZoomPanel() new OpenLayers.Control.PanZoomFMS() ]; fixmystreet.map_type = OpenLayers.Layer.Bing; } OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { - attribution: '<a href="http://www.bing.com/maps/">' + - '<img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>', + attributionTemplate: '${logo}${copyrights}', + + setMap: function() { + OpenLayers.Layer.XYZ.prototype.setMap.apply(this, arguments); + this.updateAttribution(); + this.map.events.register("moveend", this, this.updateAttribution); + }, + + updateAttribution: function() { + var z = this.map.getZoom() + this.zoomOffset; + var copyrights; + var logo = ''; + if (z >= 16) { + copyrights = 'Contains Ordnance Survey data © Crown copyright and database right 2010'; + } else { + logo = '<a href="http://www.bing.com/maps/"><img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>'; + copyrights = '© 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Ordnance Survey'; + } + this.attribution = OpenLayers.String.format(this.attributionTemplate, { + logo: logo, + copyrights: copyrights + }); + this.map && this.map.events.triggerEvent("changelayer", { + layer: this, + property: "attribution" + }); + }, initialize: function(name, options) { var url = []; diff --git a/web/js/map-streetview.js b/web/js/map-streetview.js index cfd595b95..99fdca983 100644 --- a/web/js/map-streetview.js +++ b/web/js/map-streetview.js @@ -44,6 +44,8 @@ OpenLayers.Util.onImageLoadError = function() { * - <OpenLayers.Layer.XYZ> */ OpenLayers.Layer.StreetView = OpenLayers.Class(OpenLayers.Layer.XYZ, { + attribution: 'Map contains Ordnance Survey data © Crown copyright and database right 2010.', + /** * Constructor: OpenLayers.Layer.StreetView * |