<commit_before>/* Display markers on an interactive map
 *
 * Expected data
 * markers: A cursor of geojson documents
 *
 * */

Template.map.onCreated(function() {
	this.fullscreen = new ReactiveVar(false);
});

var FaIcon = function(faClass) {
	return function() {
		return L.DomUtil.create('span', 'fa fa-'+faClass);
	}
}

var FaCompIcon = function(opClass, icClass) {
	return function() {
		var cont = L.DomUtil.create('span', 'fa');
		var op = L.DomUtil.create('i', 'fa fa-'+opClass, cont);

		var ic = L.DomUtil.create('i', 'fa fa-lg fa-'+icClass, cont)
		ic.style.position = 'absolute';
		ic.style.left = '0.7ex';
		L.DomUtil.setOpacity(ic, 0.5);

		return cont;
	}
}

var OpenkiControl = L.Control.extend({
	options: {
		icon: null,
		action: '',
		title: '',
		position: 'topright'
	},

	initialize: function(options) {
		L.Util.setOptions(this, options);
	},

	onAdd: function(map) {
		var elm = this.options.icon();
		L.DomUtil.addClass(elm, this.options.action);
		elm.setAttribute('title', this.options.title);
		return elm;
	}
});

Template.map.onRendered(function() {
	var instance = this;

	var layers = {};
	var centers = {};

	L.Icon.Default.imagePath = 'packages/bevanhunt_leaflet/images';

	var options = {
		zoomControl: false,
		attributionControl: false
	};

	var map = L.map(instance.find('.map'), options).setView(L.latLng(0,0), 1);


	// Add tiles depending on language
	var tiles = null;
	var tileLayers = {
		'de': 'OpenStreetMap.DE',
		'fr': 'OpenStreetMap.France',
		'default': 'OpenStreetMap.Mapnik'
	}
	instance.autorun(function() {
		if (tiles) map.removeLayer(tiles);
		var tileLayer = tileLayers[Session.get('locale')];
		if (!tileLayer) tileLayer = tileLayers['default'];
		tiles = L.tileLayer.provider(tileLayer);
		tiles.addTo(map);
	});<commit_msg>use SSL for getting tiles in leaflet from openstreetmap temporary fix for #275<commit_after>/* Display markers on an interactive map
 *
 * Expected data
 * markers: A cursor of geojson documents
 *
 * */

Template.map.onCreated(function() {
	this.fullscreen = new ReactiveVar(false);
});

var FaIcon = function(faClass) {
	return function() {
		return L.DomUtil.create('span', 'fa fa-'+faClass);
	}
}

var FaCompIcon = function(opClass, icClass) {
	return function() {
		var cont = L.DomUtil.create('span', 'fa');
		var op = L.DomUtil.create('i', 'fa fa-'+opClass, cont);

		var ic = L.DomUtil.create('i', 'fa fa-lg fa-'+icClass, cont)
		ic.style.position = 'absolute';
		ic.style.left = '0.7ex';
		L.DomUtil.setOpacity(ic, 0.5);

		return cont;
	}
}

var OpenkiControl = L.Control.extend({
	options: {
		icon: null,
		action: '',
		title: '',
		position: 'topright'
	},

	initialize: function(options) {
		L.Util.setOptions(this, options);
	},

	onAdd: function(map) {
		var elm = this.options.icon();
		L.DomUtil.addClass(elm, this.options.action);
		elm.setAttribute('title', this.options.title);
		return elm;
	}
});

Template.map.onRendered(function() {
	var instance = this;

	var layers = {};
	var centers = {};

	L.Icon.Default.imagePath = 'packages/bevanhunt_leaflet/images';

	var options = {
		zoomControl: false,
		attributionControl: false
	};

	var map = L.map(instance.find('.map'), options).setView(L.latLng(0,0), 1);


	// Add tiles depending on language
	var tiles = null;
	var tileLayers = {
		'de': 'OpenStreetMap.Mapnik',    // use 'OpenStreetMap.DE' here, if u dont need SSL.
		'fr': 'OpenStreetMap.Mapnik',    // use 'OpenStreetMap.France' here, if u dont want SSL.
		'default': 'OpenStreetMap.Mapnik'
	}
	instance.autorun(function() {
		if (tiles) map.removeLayer(tiles);
		var tileLayer = tileLayers[Session.get('locale')];
		if (!tileLayer) tileLayer = tileLayers['default'];
		tiles = L.tileLayer.provider(tileLayer);
		tiles.addTo(map);
	});
{'fraction_non_alphanumeric': 0.16644474034620507, 'fraction_numerical': 0.004527296937416778, 'mean_word_length': 4.055181695827725, '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': '2923357', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1350, 'n_words': 298}