Sha256: e3d24cf9851bbc62f384f1bec68ca280ade275bb05d1640c328187177b022208

Contents?: true

Size: 1 KB

Versions: 8

Compression:

Stored size: 1 KB

Contents

/*
 * L.Icon.Default is the blue marker icon used by default in Leaflet.
 */

L.Icon.Default = L.Icon.extend({

	options: {
		iconSize: [25, 41],
		iconAnchor: [12, 41],
		popupAnchor: [1, -34],

		shadowSize: [41, 41]
	},

	_getIconUrl: function (name) {
		var key = name + 'Url';

		if (this.options[key]) {
			return this.options[key];
		}

		if (L.Browser.retina && name === 'icon') {
			name += '-2x';
		}

		var path = L.Icon.Default.imagePath;

		if (!path) {
			throw new Error('Couldn\'t autodetect L.Icon.Default.imagePath, set it manually.');
		}

		return path + '/marker-' + name + '.png';
	}
});

L.Icon.Default.imagePath = (function () {
	var scripts = document.getElementsByTagName('script'),
	    leafletRe = /[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;

	var i, len, src, matches, path;

	for (i = 0, len = scripts.length; i < len; i++) {
		src = scripts[i].src;
		matches = src.match(leafletRe);

		if (matches) {
			path = src.split(leafletRe)[0];
			return (path ? path + '/' : '') + 'images';
		}
	}
}());

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
leaflet-js-0.7.9 vendor/assets/Leaflet/src/layer/marker/Icon.Default.js
leaflet-js-0.7.8 vendor/assets/Leaflet/src/layer/marker/Icon.Default.js
leaflet-js-0.7.7 vendor/assets/Leaflet/src/layer/marker/Icon.Default.js
leaflet-js-0.7.0.4 lib/leaflet/src/layer/marker/Icon.Default.js
leaflet-js-0.7.0.3 lib/leaflet/src/layer/marker/Icon.Default.js
leaflet-js-0.7.0.2 lib/leaflet/src/layer/marker/Icon.Default.js
leaflet-js-0.7.0.1 lib/leaflet/src/layer/marker/Icon.Default.js
leaflet-js-0.7.0 lib/leaflet/src/layer/marker/Icon.Default.js