2013-11-08 05:54:33 +08:00
|
|
|
describe("CRS.EPSG3395", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
var crs = L.CRS.EPSG3395;
|
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
describe("#latLngToPoint", function () {
|
|
|
|
it("projects a center point", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.latLngToPoint(L.latLng(0, 0), 0)).near(new L.Point(128, 128), 0.01);
|
2013-11-08 05:54:33 +08:00
|
|
|
});
|
2013-09-10 15:03:59 +08:00
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
it("projects the northeast corner of the world", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.latLngToPoint(L.latLng(85.0840591556, 180), 0)).near(new L.Point(256, 0));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
describe("#pointToLatLng", function () {
|
|
|
|
it("reprojects a center point", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.pointToLatLng(new L.Point(128, 128), 0)).nearLatLng(L.latLng(0, 0), 0.01);
|
2013-11-08 05:54:33 +08:00
|
|
|
});
|
2013-09-10 15:03:59 +08:00
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
it("reprojects the northeast corner of the world", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.pointToLatLng(new L.Point(256, 0), 0)).nearLatLng(L.latLng(85.0840591556, 180));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
describe("CRS.EPSG3857", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
var crs = L.CRS.EPSG3857;
|
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
describe("#latLngToPoint", function () {
|
|
|
|
it("projects a center point", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.latLngToPoint(L.latLng(0, 0), 0)).near(new L.Point(128, 128), 0.01);
|
2013-11-08 05:54:33 +08:00
|
|
|
});
|
2013-09-10 15:03:59 +08:00
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
it("projects the northeast corner of the world", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.latLngToPoint(L.latLng(85.0511287798, 180), 0)).near(new L.Point(256, 0));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
describe("#pointToLatLng", function () {
|
|
|
|
it("reprojects a center point", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.pointToLatLng(new L.Point(128, 128), 0)).nearLatLng(L.latLng(0, 0), 0.01);
|
2013-11-08 05:54:33 +08:00
|
|
|
});
|
2013-09-10 15:03:59 +08:00
|
|
|
|
2013-11-08 05:54:33 +08:00
|
|
|
it("reprojects the northeast corner of the world", function () {
|
2013-09-10 15:03:59 +08:00
|
|
|
expect(crs.pointToLatLng(new L.Point(256, 0), 0)).nearLatLng(L.latLng(85.0511287798, 180));
|
|
|
|
});
|
|
|
|
});
|
2013-11-08 05:54:33 +08:00
|
|
|
});
|