Sha256: 0d22fb6100943d282c9f62ae119287978e1543e555332132252fbe81dc4c7152

Contents?: true

Size: 1.32 KB

Versions: 7

Compression:

Stored size: 1.32 KB

Contents

(function() {
	function getFiles() {
		var memo = {},
		    files = [],
		    i, src;

		function addFiles(srcs) {
			for (var j = 0, len = srcs.length; j < len; j++) {
				memo[srcs[j]] = true;
			}
		}

		for (i in deps) {
			addFiles(deps[i].src);
		}

		for (src in memo) {
			files.push(src);
		}

		return files;
	}
	var scripts = getFiles();

	function getSrcUrl() {
		var scripts = document.getElementsByTagName('script');
		for (var i = 0; i < scripts.length; i++) {
			var src = scripts[i].src;
			if (src) {
				var res = src.match(/^(.*)leaflet-include\.js$/);
				if (res) {
					return res[1] + '../src/';
				}
			}
		}
	}

	var path = getSrcUrl();
    for (var i = 0; i < scripts.length; i++) {
		document.writeln("<script src='" + path + scripts[i] + "'></script>");
	}
    document.writeln('<script defer>L.Icon.Default.imagePath = "' + path + '../dist/images";</script>');
})();

function getRandomLatLng(map) {
	var bounds = map.getBounds(),
		southWest = bounds.getSouthWest(),
		northEast = bounds.getNorthEast(),
		lngSpan = northEast.lng - southWest.lng,
		latSpan = northEast.lat - southWest.lat;

	return new L.LatLng(
			southWest.lat + latSpan * Math.random(),
	        southWest.lng + lngSpan * Math.random());
}

function logEvent(e) {
	console.log(e.type);
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
leaflet-js-0.8.dev2 lib/leaflet/debug/leaflet-include.js
leaflet-js-0.7.0.4 lib/leaflet/debug/leaflet-include.js
leaflet-js-0.7.0.3 lib/leaflet/debug/leaflet-include.js
leaflet-js-0.7.0.2 lib/leaflet/debug/leaflet-include.js
leaflet-js-0.7.0.1 lib/leaflet/debug/leaflet-include.js
leaflet-js-0.7.0 lib/leaflet/debug/leaflet-include.js
leaflet-js-0.6.beta4 lib/leaflet/debug/leaflet-include.js