aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js18
-rw-r--r--web/js/map-bing-ol.js33
2 files changed, 28 insertions, 23 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 3634160ff..fa46656e9 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -82,15 +82,17 @@ $(function(){
$('html').addClass('mobile');
} else {
// Make map full screen on non-mobile sizes.
- // temp: exclude ie6 as it doesn't like the height part of this
- if(!$('html').hasClass('ie6')){
- $('#map_box').prependTo('.wrapper').css({
- zIndex: 0, position: 'fixed',
- top: 0, left: 0, right: 0, bottom: 0,
- width: '100%', height: '100%',
- margin: 0
- }).data('size', 'full');
+ var map_pos = 'fixed', map_height = '100%';
+ if ($('html').hasClass('ie6')) {
+ map_pos = 'absolute';
+ map_height = $(window).height();
}
+ $('#map_box').prependTo('.wrapper').css({
+ zIndex: 0, position: map_pos,
+ top: 0, left: 0, right: 0, bottom: 0,
+ width: '100%', height: map_height,
+ margin: 0
+ }).data('size', 'full');
}
//heightfix the desktop .content div
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js
index 94b777134..588f8d45b 100644
--- a/web/js/map-bing-ol.js
+++ b/web/js/map-bing-ol.js
@@ -2,7 +2,7 @@ function set_map_config(perm) {
fixmystreet.controls = [
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.ArgParser(),
- new OpenLayers.Control.Navigation(),
+ new OpenLayers.Control.Navigation({ zoomWheelEnabled: false }),
perm,
//new OpenLayers.Control.ZoomPanel()
new OpenLayers.Control.PanZoomFMS()
@@ -33,10 +33,12 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
logo: logo,
copyrights: copyrights
});
- this.map && this.map.events.triggerEvent("changelayer", {
- layer: this,
- property: "attribution"
- });
+ if (this.map) {
+ this.map.events.triggerEvent("changelayer", {
+ layer: this,
+ property: "attribution"
+ });
+ }
},
initialize: function(name, options) {
@@ -59,10 +61,10 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
for (var i = level; i > 0; i--) {
var digit = 0;
var mask = 1 << (i - 1);
- if ((x & mask) != 0) {
+ if ((x & mask) !== 0) {
digit++;
}
- if ((y & mask) != 0) {
+ if ((y & mask) !== 0) {
digit += 2;
}
key += digit;
@@ -72,16 +74,17 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
getURL: function (bounds) {
var res = this.map.getResolution();
- var x = Math.round((bounds.left - this.maxExtent.left)
- / (res * this.tileSize.w));
- var y = Math.round((this.maxExtent.top - bounds.top)
- / (res * this.tileSize.h));
- var z = this.serverResolutions != null ?
+ var x = Math.round((bounds.left - this.maxExtent.left) /
+ (res * this.tileSize.w));
+ var y = Math.round((this.maxExtent.top - bounds.top) /
+ (res * this.tileSize.h));
+ var z = this.serverResolutions !== null ?
OpenLayers.Util.indexOf(this.serverResolutions, res) :
this.map.getZoom() + this.zoomOffset;
+ var url;
if (z >= 16) {
- var url = [
+ url = [
"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",
@@ -89,8 +92,8 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
];
} else {
var type = '';
- if (z > 10) type = '&productSet=mmOS';
- var url = [
+ if (z > 10) { type = '&productSet=mmOS'; }
+ url = [
"http://ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
"http://ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
"http://ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,