Sha256: ffa18814f5f9535a9eaccade56d6e1c36afd6c3bfc57e2a4f9aa116c94427588

Contents?: true

Size: 845 Bytes

Versions: 8

Compression:

Stored size: 845 Bytes

Contents

/*
 * 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);
	},

	getSize: function (zoom) {
		var s = this.scale(zoom);
		return L.point(s, s);
	}
};

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
leaflet-js-0.7.9 vendor/assets/Leaflet/src/geo/crs/CRS.js
leaflet-js-0.7.8 vendor/assets/Leaflet/src/geo/crs/CRS.js
leaflet-js-0.7.7 vendor/assets/Leaflet/src/geo/crs/CRS.js
leaflet-js-0.7.0.4 lib/leaflet/src/geo/crs/CRS.js
leaflet-js-0.7.0.3 lib/leaflet/src/geo/crs/CRS.js
leaflet-js-0.7.0.2 lib/leaflet/src/geo/crs/CRS.js
leaflet-js-0.7.0.1 lib/leaflet/src/geo/crs/CRS.js
leaflet-js-0.7.0 lib/leaflet/src/geo/crs/CRS.js