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;
	var inputEl = document.querySelector('#mapsearch');
	var locationEl = document.querySelector('#geo-gps');
	this.locationData = { lat: y, long: x };

	var suggest = new SMap.Suggest(inputEl, {
			updateParams: (params) => {
				/*
      	tato fce se vola pred kazdym zavolanim naseptavace,
        params je objekt, staci prepsat/pridat klic a ten se prida 
        do url
      */
				var c = m.getCenter().toWGS84();
				params.lon = c[0].toFixed(6);
				params.lat = c[1].toFixed(6);
				params.zoom = m.getZoom();
				// omezeni pro celou CR
				params.bounds = '48.5370786,12.0921668|51.0746358,18.8927040';
				// povolime kategorie
				params.enableCategories = 1;
				// priorita jazyku, oddelene carkou
				params.lang = 'cs,en';
			},
	});
	suggest.addListener('suggest', (suggestData) => {
		this.moveMarker(suggestData.data.longitude, suggestData.data.latitude);
	});

	this.moveMarker = function (long, lat) {
		this.layer.removeAll();
		this.addMarker(long, lat, true);
	};

	this.addMarker = function (long, lat, draggable = false) {
		this.markerCount++;
		var markerId = 'myMarker' + this.markerCount;
		var options = {
			title: 'Dobré ráno',
		};
		var point = SMap.Coords.fromWGS84(long, lat);
		var marker = new SMap.Marker(point, markerId, options);
		if (draggable) {
			marker.decorate(SMap.Marker.Feature.Draggable);
			function stop(e) {
				var coords = e.target.getCoords();
				locationEl.value = coords.y.toFixed(6) + ', ' + coords.x.toFixed(6);
				this.locationData = { lat: coords.y, long: coords.x };
			}

			var signals = this.m.getSignals();
			signals.addListener(window, 'marker-drag-stop', stop.bind(this));
		}
		this.locationData = { lat, long };
		locationEl.value = lat.toFixed(6) + ', ' + long.toFixed(6);
		this.layer.addMarker(marker);
		this.m.setCenter(point, false);
		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.431195, 50.085435);
var id = map.addMarker(14.431195, 50.085435, true);
$map = map;
`