diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-07-01 11:31:32 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-07-01 12:45:22 +0100 |
commit | c6a20311276f00befd27fe0ea7e606db4a13844d (patch) | |
tree | a72eec3c6e1654dac232137ee367c4a622f70a48 | |
parent | ca5761ae2542de544f48f6338d7d81f8711d3caf (diff) |
Use our own StreetView tile server, add missing IE6 CSS for OpenLayers, don't set map parameter in JS.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 2 | ||||
-rw-r--r-- | templates/web/default/maps/fms.html | 3 | ||||
-rw-r--r-- | templates/web/default/maps/osm-streetview.html | 3 | ||||
-rw-r--r-- | templates/web/default/maps/osm.html | 3 | ||||
-rw-r--r-- | templates/web/default/maps/tilma/openlayers.html | 3 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 6 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 7 |
9 files changed, 24 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 0f5450d5f..fcf91123e 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -239,6 +239,11 @@ sub ajax : Path('/ajax') { my $all_pins = $c->req->param('all_pins') ? 1 : undef; my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age; + # Need to be the class that can handle it + if ($c->req->param('bbox')) { + FixMyStreet::Map::set_map_class( 'OSM' ); + } + # extract the data from the map my ( $pins, $on_map, $around_map, $dist ) = FixMyStreet::Map::map_pins( $c, $interval ); diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm index b1359ae03..e5346f3d9 100644 --- a/perllib/FixMyStreet/App/Controller/My.pm +++ b/perllib/FixMyStreet/App/Controller/My.pm @@ -25,9 +25,6 @@ sub my : Path : Args(0) { $c->detach( '/auth/redirect' ) unless $c->user; - # Even though front end doesn't yet have it, have it on this page, it's better! - FixMyStreet::Map::set_map_class( 'FMS' ); - my $p_page = $c->req->params->{p} || 1; my $u_page = $c->req->params->{u} || 1; diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index e533ea347..61218448b 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -102,8 +102,6 @@ sub ward : Path : Args(2) { my $pins = $c->stash->{pins}; - # Even though front end doesn't yet have it, have it on this page, it's better! - FixMyStreet::Map::set_map_class( 'FMS' ); FixMyStreet::Map::display_map( $c, latitude => @$pins ? $pins->[0]{latitude} : 0, diff --git a/templates/web/default/maps/fms.html b/templates/web/default/maps/fms.html index 36fd48467..6e6d747bf 100644 --- a/templates/web/default/maps/fms.html +++ b/templates/web/default/maps/fms.html @@ -3,6 +3,9 @@ <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> +<!--[if lte IE 6]> + <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> +<![endif]--> [% END %] [% map_html = BLOCK %] diff --git a/templates/web/default/maps/osm-streetview.html b/templates/web/default/maps/osm-streetview.html index ba8d1fba4..9de99c253 100644 --- a/templates/web/default/maps/osm-streetview.html +++ b/templates/web/default/maps/osm-streetview.html @@ -2,6 +2,9 @@ <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-streetview.js"></script> +<!--[if lte IE 6]> + <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> +<![endif]--> [% END %] [% map_html = BLOCK %] diff --git a/templates/web/default/maps/osm.html b/templates/web/default/maps/osm.html index c6529566e..e2762ee26 100644 --- a/templates/web/default/maps/osm.html +++ b/templates/web/default/maps/osm.html @@ -2,6 +2,9 @@ <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-OpenStreetMap.js"></script> +<!--[if lte IE 6]> + <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> +<![endif]--> [% END %] [% map_html = BLOCK %] diff --git a/templates/web/default/maps/tilma/openlayers.html b/templates/web/default/maps/tilma/openlayers.html index c8ae53bfe..ea3219296 100644 --- a/templates/web/default/maps/tilma/openlayers.html +++ b/templates/web/default/maps/tilma/openlayers.html @@ -3,6 +3,9 @@ <script type="text/javascript" src="/js/map-OpenLayers.js"></script> <script type="text/javascript" src="/js/map-tilma-ol.js"></script> <script type="text/javascript" src="/js/OpenLayers.Projection.OrdnanceSurvey.js"></script> +<!--[if lte IE 6]> + <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> +<![endif]--> [% END %] [% map_html = BLOCK %] diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 821bbafc3..789d8f16e 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -73,7 +73,7 @@ YAHOO.util.Event.onContentReady('map', function() { pin_layer_options.strategies = [ new OpenLayers.Strategy.BBOX() ]; pin_layer_options.protocol = new OpenLayers.Protocol.HTTP({ url: '/ajax', - params: fixmystreet.all_pins ? { all_pins: 1, map: 'FMS' } : { map: 'FMS' }, + params: fixmystreet.all_pins ? { all_pins: 1 } : { }, format: new OpenLayers.Format.FixMyStreet() }); } @@ -151,12 +151,12 @@ YAHOO.util.Event.addListener('all_pins_link', 'click', function(e) { for (var i=0; i<texts.length; i+=3) { if (this.innerHTML == texts[i+1]) { this.innerHTML = texts[i+2]; - fixmystreet.markers.protocol.options.params = { all_pins: 1, map: 'FMS' }; + fixmystreet.markers.protocol.options.params = { all_pins: 1 }; fixmystreet.markers.refresh( { force: true } ); lang = texts[i]; } else if (this.innerHTML == texts[i+2]) { this.innerHTML = texts[i+1]; - fixmystreet.markers.protocol.options.params = { map: 'FMS' }; + fixmystreet.markers.protocol.options.params = { }; fixmystreet.markers.refresh( { force: true } ); lang = texts[i]; } diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 75bce80d3..406524883 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -56,9 +56,10 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { if (z >= 16) { var url = [ - "http://a.os.openstreetmap.org/sv/${z}/${x}/${y}.png", - "http://b.os.openstreetmap.org/sv/${z}/${x}/${y}.png", - "http://c.os.openstreetmap.org/sv/${z}/${x}/${y}.png" + "http://tilma.mysociety.org/sv/${z}/${x}/${y}.png", + "http://a.tilma.mysociety.org/sv/${z}/${x}/${y}.png", + "http://b.tilma.mysociety.org/sv/${z}/${x}/${y}.png", + "http://c.tilma.mysociety.org/sv/${z}/${x}/${y}.png" ]; } else { var url = [ |