proper EPSG:4326 with 2x1 root, fixes #1207

This commit is contained in:
Vladimir Agafonkin 2013-11-28 00:59:39 +02:00
parent ce79ea1e81
commit 00166b9c4f
4 changed files with 9 additions and 5 deletions

View File

@ -20,7 +20,7 @@
var bluemarble = new L.TileLayer.WMS("http://maps.opengeo.org/geowebcache/service/wms", {
layers: 'bluemarble',
attribution: "Data © NASA Blue Marble, image service by OpenGeo",
minZoom: 2,
minZoom: 0,
maxZoom: 5
});

View File

@ -70,9 +70,9 @@ describe("CRS.EPSG4326", function () {
crsSize;
for (i = 0; i <= 22; i++) {
crsSize = crs.getSize(i);
expect(crsSize.x).equal(worldSize);
expect(crsSize.x).equal(worldSize * 2);
// Lat bounds are half as high (-90/+90 compared to -180/+180)
expect(crsSize.y).equal(worldSize / 2);
expect(crsSize.y).equal(worldSize);
worldSize *= 2;
}
});

View File

@ -10,5 +10,7 @@ L.CRS.EPSG3395 = L.extend({}, L.CRS, {
scale = 0.5 / (Math.PI * r);
return new L.Transformation(scale, 0.5, -scale, 0.5);
}())
}()),
wrapLng: true
});

View File

@ -6,5 +6,7 @@ L.CRS.EPSG4326 = L.extend({}, L.CRS, {
code: 'EPSG:4326',
projection: L.Projection.LonLat,
transformation: new L.Transformation(1 / 360, 0.5, -1 / 360, 0.5)
transformation: new L.Transformation(1 / 180, 1, -1 / 180, 0.5),
wrapLng: true
});