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-vector.html
{% assign id = include.map-id %}
{% assign data = site.data.maps-vector[id] %}
{% assign color = include.color | default: data.color | default: 'green' %}

{% if data %}
	{% if jekyll.environment == 'development' %}
		<div class="ratio ratio-{{ include.ratio | default: '4x3' }}">
			{% include ui/svg.html width="590" height="252" ratio=true border=true %}
		</div>
	{% else %}
		<div class="ratio ratio-{{ include.ratio | default: '4x3' }}">
			<div>
				<div id="map-{{ id }}" class="w-100 h-100"></div>
			</div>
		</div>

		{% capture script %}
		<script>
			// @formatter:on
			{% if jekyll.environment == 'development' %}window.tabler_map_vector = window.tabler_map_vector || {};{% endif %}

			document.addEventListener("DOMContentLoaded", function() {
				const map = {% if jekyll.environment == 'development' %}window.tabler_map_vector["map-{{ id }}"] = {% endif %}new jsVectorMap({
					selector: '#map-{{ id }}',
					map: '{{ data.map }}',
					backgroundColor: 'transparent',
					regionStyle: {
						initial: {
							{% unless data.filled %}
							fill: tabler.getColor('body-bg'),
							stroke: tabler.getColor('border-color'),
							strokeWidth: 2,
							{% else %}
							fill: tabler.getColor('body-bg'),
							stroke: '#fff',
							strokeWidth: 1,
							{% endunless %}
						}
					},
					zoomOnScroll: {% if data.zoom %}true{% else %}false{% endif %},
					zoomButtons: {% if data.zoom %}true{% else %}false{% endif %},
					{% if data.values %}
					// -------- Series --------
					visualizeData: {
						scale: [tabler.getColor('bg-surface'), tabler.getColor('{{ data.color }}')],
						values: {{ data.values }},
					},
					{% endif %}
					{% if data.markers %}
					markers: [
						{% for marker in data.markers %}
						{
							coords: [{{ marker.coords }}],
							name: "{{ marker.name }}",
						},
						{% endfor %}
					],
					markerStyle: {
						initial: {
							r: 4,
							stroke: '#fff',
							opacity: 1,
							strokeWidth: 3,
							stokeOpacity: .5,
							fill: tabler.getColor('{{ color }}')
						},
						hover: {
							fill: tabler.getColor('{{ color }}'),
							stroke: tabler.getColor('{{ color }}')
						}
					},
					markerLabelStyle: {
						initial: {
							fontSize: 10
						},
					},
					labels: {
						markers: {
							render: function(marker) {
								return marker.name
							},
						},
					},
					{% endif %}
					{% if data.lines %}
					lines: [
						{% for line in data.lines %}
						{
							from: "{{ line.from }}",
							to: "{{ line.to }}"
						},
						{% endfor %}
					],
					lineStyle: {
						strokeDasharray:"4 4",
						animation: true,
						stroke: "rgba(98, 105, 118, .75)",
						strokeWidth: .5,
					},
					{% endif %}
				});

				window.addEventListener("resize", () => {
					map.updateSize();
				});
			});
			// @formatter:off
		</script>
		{% endcapture %}

		{% if include.show-scripts %}
			{{ script }}
		{% else %}
			{% capture_global scripts %}
				{{ script }}
			{% endcapture_global %}
		{% endif %}
	{% endif %}
{% endif %}