Code coverage report for src/geo/crs/CRS.js

Statements: 85.71% (6 / 7)      Branches: 100% (0 / 0)      Functions: 75% (3 / 4)      Lines: 85.71% (6 / 7)     

All files » src/geo/crs/ » CRS.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28        1   40     40       2     2               42      
/*
 * L.CRS is a base object for all defined CRS (Coordinate Reference Systems) in Leaflet.
 */
 
L.CRS = {
	latLngToPoint: function (latlng, zoom) { // (LatLng, Number) -> Point
		var projectedPoint = this.projection.project(latlng),
		    scale = this.scale(zoom);
 
		return this.transformation._transform(projectedPoint, scale);
	},
 
	pointToLatLng: function (point, zoom) { // (Point, Number[, Boolean]) -> LatLng
		var scale = this.scale(zoom),
		    untransformedPoint = this.transformation.untransform(point, scale);
 
		return this.projection.unproject(untransformedPoint);
	},
 
	project: function (latlng) {
		return this.projection.project(latlng);
	},
 
	scale: function (zoom) {
		return 256 * Math.pow(2, zoom);
	}
};