<?php
if($jsl["koordinat"]<>""){ $LatLng=$jsl["koordinat"]; $firstHeading=$rs["t1"]; $adres=$jsl["adres"]; }else{ $LatLng=$firm["fmap"]; $firstHeading=$firma; $adres=$firm["fadres"]; }
$ymap="
	<script src='https://api-maps.yandex.ru/2.1/?apikey=".tanim("mkey","n1",0)."&types=geo&lang=tr_TR' type='text/javascript'></script>
	<script type = \"text/javascript\">
	ymaps.ready(init);
	var crmplusMaps;
	function init() {
		crmplusMaps = new ymaps.Map('map_canvas', {
			center: [".$LatLng."],
			zoom: 16,
			controls: ['zoomControl', 'typeSelector', 'fullscreenControl']
		});
		var myPlacemark = new ymaps.Placemark([".$LatLng."], {
			balloonContentHeader: '".$firstHeading."',
			balloonContentBody: '<img src=\"".$logo."\" class=\"img-responsive\" width=\"100\"> ',
			balloonContentFooter: \"".$weburl."\"
		}, {
			preset: 'islands#redDotIcon',
			draggable: false
		});
		myPlacemark.events.add('dragend', function(e) {
			var thisPlacemark = e.get('target');
			var coords = thisPlacemark.geometry.getCoordinates();
			thisPlacemark.properties.set('balloonContent', coords);
		});
		crmplusMaps.setCenter([".$LatLng."]);
		crmplusMaps.setZoom(16, {
			duration: 10000
		});
		crmplusMaps.panTo([".$LatLng."], {
			checkZoomRange: true
		});
		crmplusMaps.geoObjects.removeAll(myPlacemark);
		crmplusMaps.geoObjects.add(myPlacemark);
	} 
	</script>
	<div id=\"map_canvas\" style=\"width:100%; min-height:350px;\"></div>
";
echo $ymap;
?>
