Add support for JPEG encoding option for HDMaps

This commit is contained in:
Mike Primm 2011-08-12 14:44:49 +08:00 committed by mikeprimm
parent 49b38c10b7
commit d008548306
11 changed files with 72 additions and 33 deletions

View file

@ -260,7 +260,8 @@ var DynmapTileLayer = L.TileLayer.extend({
zoom: this.zoomprefix(zoomoutlevel),
zoomprefix: (zoomoutlevel==0)?"":(this.zoomprefix(zoomoutlevel)+"_"),
x: x,
y: y
y: y,
fmt: this.options['image-format'] || 'png'
};
}
});

View file

@ -36,7 +36,7 @@ var HDMapType = DynmapTileLayer.extend({
// Y is inverted for HD-map.
info.y = -info.y;
info.scaledy = info.y >> 5;
return namedReplace('{prefix}{nightday}/{scaledx}_{scaledy}/{zoom}{x}_{y}.png', info);
return namedReplace('{prefix}{nightday}/{scaledx}_{scaledy}/{zoom}{x}_{y}.{fmt}', info);
},
zoomprefix: function(amount) {
// amount == 0 -> ''