export const jsStr = `
function createMap(x, y) {
	this.center = SMap.Coords.fromWGS84(x, y);

	var m = new SMap(JAK.gel('mapa'), this.center, 13);
	m.addDefaultLayer(SMap.DEF_BASE).enable();
	m.addDefaultControls();
	var layer = new SMap.Layer.Marker();
	m.addLayer(layer);
	layer.enable();
	this.m = m;
	this.layer = layer;
	this.markerCount = 0;

	this.addMarker = function (long, lat, body = null, header = null, imageUrl) {
		this.markerCount++;
		var znacka = JAK.mel('div');
		var obrazek = JAK.mel('img', {
			src: imageUrl,
		});
		znacka.appendChild(obrazek);
		var card = new SMap.Card();
		if (body && header) {
			card.getHeader().innerHTML = header;
			card.getBody().innerHTML = body;
		} else {
			card.getHeader().innerHTML = '<h3>Nadpis</h3>';
			card.getBody().innerHTML = 'Ahoj, já jsem <em>obsah vizitky</em>!';
		}
		var markerId = 'myMarker' + this.markerCount;
		var options = {
			title: 'Dobré ráno',
			url: znacka,
		};
		var point = SMap.Coords.fromWGS84(long, lat);
		var marker = new SMap.Marker(point, markerId, options);

		marker.decorate(SMap.Marker.Feature.Card, card);
		this.layer.addMarker(marker);
		var computedCenter = this.m.computeCenterZoom(
			this.layer.getMarkers().map((i) => i.getCoords()),
		);
		this.m.setCenterZoom(computedCenter[0], computedCenter[1]);
		return markerId;
	};

	this.removeMarker = function (id) {
		var markers = this.layer.getMarkers();
		var selMarker = markers.find((m) => m._id == id);
		this.layer.removeMarker(selMarker);
	};
}
var map = new createMap(14.4179, 50.12655);
$map = map;

`