From e08a2d4407a3502e54d3da54afee553fa15b4c5c Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 2 Aug 2011 00:07:17 -0500 Subject: [PATCH] Fix background color support, provide blank tile to fix refresh junk --- web/images/blank.png | Bin 0 -> 167 bytes web/js/flatmap.js | 3 ++- web/js/hdmap.js | 3 ++- web/js/kzedmaps.js | 3 ++- web/js/map.js | 17 +++++++++-------- 5 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 web/images/blank.png diff --git a/web/images/blank.png b/web/images/blank.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d10928ac34937de5c8af5575764128410970cf GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H3?#oinD`S&NtU=qlmzFem6RtIr7}3C@kk_Q}e|?^Z1Bi(X-m5h*Ff%wbFfe9)Uhxqmvd$@?2>=WeE*}5@ literal 0 HcmV?d00001 diff --git a/web/js/flatmap.js b/web/js/flatmap.js index ad2c8a9a..58e27b33 100644 --- a/web/js/flatmap.js +++ b/web/js/flatmap.js @@ -10,7 +10,8 @@ var FlatProjection = DynmapProjection.extend({ var FlatMapType = DynmapTileLayer.extend({ options: { minZoom: 0, - maxZoom: 4 + maxZoom: 4, + errorTileUrl: 'images/blank.png' }, initialize: function(options) { options.maxzoomout = options.mapzoomout || options.world.extrazoomout; diff --git a/web/js/hdmap.js b/web/js/hdmap.js index 2aa5add3..af905ebf 100644 --- a/web/js/hdmap.js +++ b/web/js/hdmap.js @@ -14,7 +14,8 @@ var HDMapType = DynmapTileLayer.extend({ projection: undefined, options: { minZoom: 0, - maxZoom: 0 + maxZoom: 0, + errorTileUrl: 'images/blank.png' }, initialize: function(options) { options.maxZoom = options.mapzoomin + options.mapzoomout; diff --git a/web/js/kzedmaps.js b/web/js/kzedmaps.js index f5364f53..c971696a 100644 --- a/web/js/kzedmaps.js +++ b/web/js/kzedmaps.js @@ -16,7 +16,8 @@ var KzedProjection = DynmapProjection.extend({ var KzedMapType = DynmapTileLayer.extend({ options: { minZoom: 0, - maxZoom: 4 + maxZoom: 4, + errorTileUrl: 'images/blank.png' }, initialize: function(options) { options.mapzoomout = options.mapzoomout || options.world.extrazoomout; diff --git a/web/js/map.js b/web/js/map.js index f426cb67..0fda5afc 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -599,18 +599,19 @@ DynMap.prototype = { var me = this; var col = "#000000"; if(me.serverday) { - if(me.maptype.backgroundday) - col = me.maptype.backgroundday; - else if(me.maptype.background) - col = me.maptype.background; + if(me.maptype.options.backgroundday) + col = me.maptype.options.backgroundday; + else if(me.maptype.options.background) + col = me.maptype.options.background; } else { - if(me.maptype.backgroundnight) - col = me.maptype.backgroundnight; - else if(me.maptype.background) - col = me.maptype.background; + if(me.maptype.options.backgroundnight) + col = me.maptype.options.backgroundnight; + else if(me.maptype.options.background) + col = me.maptype.options.background; } $('.map').css('background', col); + $('.leaflet-tile').css('background', col); }, getParameterByName: function(name) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");