<commit_before>L.Marker = L.Class.extend({
	includes: L.Mixin.Events,
	
	options: {
		icon: new L.Icon(),
		clickable: true
	},
	
	initialize: function(latlng, options) {
		this._latlng = latlng;	
	},
	
	onAdd: function(map) {
		this._map = map;
		
		if (!this._icon) {
			this._icon = this.options.icon.createIcon();
			map._panes.markerPane.appendChild(this._icon);
			this._initInteraction();
		}
		if (!this._shadow) {
			this._shadow = this.options.icon.createShadow();
			map._panes.shadowPane.appendChild(this._shadow);
		}
		
		map.on('viewreset', this._reset, this);
		this._reset();
	},
	
	onRemove: function(map) {
		if (this._icon) {
			map._panes.markerPane.removeChild(this._icon);
		}
		if (!this._shadow) {
			map._panes.shadowPane.removeChild(this._shadow);
		}
		map.off('viewreset', this._reset, this);
	},
	
	getLatLng: function() {
		return this._latlng;
	},
	
	_reset: function() {
		var pos = this._map.latLngToLayerPoint(this._latlng);
		
		L.DomUtil.setPosition(this._icon, pos);
		L.DomUtil.setPosition(this._shadow, pos);
		
		this._icon.style.zIndex = pos.y;
	},
	
	_initInteraction: function() {
		if (this.options.clickable) {
			this._icon.className += ' leaflet-clickable';
			L.DomEvent.addListener(this._icon, 'mousedown', this._fireMouseEvent, this);
			L.DomEvent.addListener(this._icon, 'click', this._fireMouseEvent, this);
		}
	},
	
	_fireMouseEvent: function(e) {
		this.fire(e.type);
		L.DomEvent.stopPropagation(e);
	}
});<commit_msg>stop marker doubleclick propagation<commit_after>L.Marker = L.Class.extend({
	includes: L.Mixin.Events,
	
	options: {
		icon: new L.Icon(),
		clickable: true
	},
	
	initialize: function(latlng, options) {
		this._latlng = latlng;	
		//TODO override default options
	},
	
	onAdd: function(map) {
		this._map = map;
		
		if (!this._icon) {
			this._icon = this.options.icon.createIcon();
			map._panes.markerPane.appendChild(this._icon);
			this._initInteraction();
		}
		if (!this._shadow) {
			this._shadow = this.options.icon.createShadow();
			map._panes.shadowPane.appendChild(this._shadow);
		}
		
		map.on('viewreset', this._reset, this);
		this._reset();
	},
	
	onRemove: function(map) {
		if (this._icon) {
			map._panes.markerPane.removeChild(this._icon);
		}
		if (!this._shadow) {
			map._panes.shadowPane.removeChild(this._shadow);
		}
		map.off('viewreset', this._reset, this);
	},
	
	getLatLng: function() {
		return this._latlng;
	},
	
	_reset: function() {
		var pos = this._map.latLngToLayerPoint(this._latlng);
		
		L.DomUtil.setPosition(this._icon, pos);
		L.DomUtil.setPosition(this._shadow, pos);
		
		this._icon.style.zIndex = pos.y;
	},
	
	_initInteraction: function() {
		if (this.options.clickable) {
			this._icon.className += ' leaflet-clickable';
			L.DomEvent.addListener(this._icon, 'mousedown', this._fireMouseEvent, this);
			L.DomEvent.addListener(this._icon, 'click', this._fireMouseEvent, this);
			L.DomEvent.addListener(this._icon, 'dblclick', this._fireMouseEvent, this);
		}
	},
	
	_fireMouseEvent: function(e) {
		this.fire(e.type);
		L.DomEvent.stopPropagation(e);
	}
});
{'fraction_non_alphanumeric': 0.16261742792355038, 'fraction_numerical': 0.0, 'mean_word_length': 3.80248833592535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6570364', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1121, 'n_words': 167}