HEX
Server: Apache
System: Linux srv4.garantili.com.tr 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: ekspardev (1006)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/ekspardev/public_html/tubisad/rapor/src/pages/_includes/ui/map.html
{% assign id = include.map-id %}
{% assign data = site.data.maps[id] %}

{% if data %}
	<div class="ratio ratio-{{ data.ratio | default: include.ratio | default: '16x9' }}">
		<div>
			<div id="map-{{ id }}" class="w-100 h-100{% if data.card %} rounded{% endif %}"></div>
		</div>
	</div>

	{% capture_global scripts %}
	<script>
		// @formatter:off
		{% if jekyll.environment == 'development' %}window.tabler_map = window.tabler_map || {};{% endif %}

		document.addEventListener("DOMContentLoaded", function() {
			mapboxgl.accessToken = '{{ site.mapbox-key }}';
			var map = new mapboxgl.Map({
				container: 'map-{{ id }}',
				style: 'mapbox://styles/mapbox/{{ data.style | default: "streets-v11" }}',
				zoom: {{ data.zoom | default: 13 }},
				{% if data.center %}
				center: [{{ data.center[1] }}, {{ data.center[0] }}],
				{% else %}
				center: [13.404900, 52.518827],
				{% endif %}
			});

			{% for marker in data.markers %}

			new mapboxgl.Marker({ color: tabler.getColor("{{ 'primary' }}") }).setLngLat([{{ marker.center[1] }}, {{ marker.center[0] }}]).addTo(map);
			{% endfor %}

			{% if jekyll.environment == 'development' %}window.tabler_map["map-{{ map-id }}"] = map;{% endif %}
		});
		// @formatter:on
	</script>
	{% endcapture_global %}
{% endif %}