"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spec/suites/layer/tile/TileLayerSpec.js" between
Leaflet-1.8.0.tar.gz and Leaflet-1.9.0.tar.gz

About: Leaflet is a JavaScript library for mobile-friendly interactive maps.

TileLayerSpec.js  (Leaflet-1.8.0):TileLayerSpec.js  (Leaflet-1.9.0)
skipping to change at line 432 skipping to change at line 432
it('uses crossOrigin value ' + crossOrigin, function () { it('uses crossOrigin value ' + crossOrigin, function () {
var layer = L.tileLayer('http://example.com/{z}/{ y}/{x}.png', { var layer = L.tileLayer('http://example.com/{z}/{ y}/{x}.png', {
crossOrigin: crossOrigin crossOrigin: crossOrigin
}).addTo(map); }).addTo(map);
eachImg(layer, function (img) { eachImg(layer, function (img) {
expect(img.getAttribute('crossorigin')).t o.be(expectedValue); expect(img.getAttribute('crossorigin')).t o.be(expectedValue);
}); });
}); });
} }
it('sets min/maxZoom appropriately with detectRetina', function (
done) {
var maxZoom = 1;
var minZoom = 1;
// override retina to load extra tiles
var originalRetina = L.Browser.retina;
L.Browser.retina = true;
var kittenLayer = kittenLayerFactory({
maxZoom: maxZoom,
minZoom: minZoom,
detectRetina: true
});
kittenLayer.on('load', function () {
expect(kittenLayer.options.maxZoom).to.be(maxZoom
);
expect(kittenLayer.options.minZoom).to.be(minZoom
);
// reset retina value
L.Browser.retina = originalRetina;
done();
});
map.addLayer(kittenLayer).setView([0, 0], 1);
});
it('resets invalid min/maxZoom to allow for tiles to be loaded wi
thout detectRetina', function (done) {
// override retina to load extra tiles
var originalRetina = L.Browser.retina;
L.Browser.retina = false;
var kittenLayer = kittenLayerFactory({
// invalid min/maxZoom
maxZoom: 9,
minZoom: 10,
detectRetina: false
});
kittenLayer.on('load', function () {
// zooms should be identical so that we can load
tiles for the given zoom level
expect(kittenLayer.options.maxZoom).to.be(kittenL
ayer.options.minZoom);
// reset retina value
L.Browser.retina = originalRetina;
done();
});
map.addLayer(kittenLayer).setView([0, 0], 1);
});
}); });
describe('#setUrl', function () { describe('#setUrl', function () {
it('fires only one load event', function (done) { it('fires only one load event', function (done) {
if (L.Browser.ie) { this.retries(3); } if (L.Browser.ie) { this.retries(3); }
var layer = L.tileLayer(placeKitten).addTo(map); var layer = L.tileLayer(placeKitten).addTo(map);
var counts = { var counts = {
load: 0, load: 0,
tileload: 0 tileload: 0
 End of changes. 1 change blocks. 
0 lines changed or deleted 58 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)