74 lines
2.8 KiB
PHP
74 lines
2.8 KiB
PHP
<?php
|
|
echo render('_header_nomenu', ['title'=>$prochazka['name'] ?? null]);
|
|
?>
|
|
<h1 class="title"><?=$prochazka['name'];?></h1>
|
|
<strong class="subtitle"><?=$prochazka['subtitle'];?></strong>
|
|
<div class="content"><?=$prochazka['text'];?></div>
|
|
|
|
|
|
<table class="table">
|
|
<?php if($prochazka['facebook_url']) { ?>}
|
|
<tr>
|
|
<th>odkaz na událost</th>
|
|
<td><a href="<?= $prochazka['facebook_url'];?>">zde</a></td>
|
|
</tr>
|
|
<?php } ?>
|
|
<tr>
|
|
<th>datum a čas</th>
|
|
<td><?=date('j.n.Y H:i', $prochazka['datetime']);?></td>
|
|
</tr>
|
|
<tr>
|
|
<th>místo srazu</th>
|
|
<td><?=$prochazka['place_descrition'];?></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div id="map"></div>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.js"></script>
|
|
<script src="https://cdn.maptiler.com/mapbox-gl-js/v1.5.1/mapbox-gl.js"></script>
|
|
<script src="https://cdn.maptiler.com/mapbox-gl-leaflet/latest/leaflet-mapbox-gl.js"></script>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.css" />
|
|
<link rel="stylesheet" href="https://cdn.maptiler.com/mapbox-gl-js/v1.5.1/mapbox-gl.css" />
|
|
<style>
|
|
#map {
|
|
height: 500px;
|
|
}
|
|
</style>
|
|
<script>
|
|
function webgl_support() {
|
|
try {
|
|
var canvas = document.createElement('canvas');
|
|
return !!window.WebGLRenderingContext &&
|
|
(canvas.getContext('webgl') || canvas.getContext('experimental-webgl'));
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function detectMob() {
|
|
return ( ( window.innerWidth <= 800 ) && ( window.innerHeight <= 600 ) );
|
|
}
|
|
|
|
|
|
|
|
var map = L.map('map').setView([<?php echo $prochazka['lat'] . ','. $prochazka['lon']; ?>], 15);
|
|
|
|
if (!webgl_support() || detectMob()) {
|
|
var OpenStreetMap_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
maxZoom: 19,
|
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
}).addTo(map);
|
|
} else {
|
|
var gl = L.mapboxGL({
|
|
attribution: "\u003ca href=\"https://svita.cz/\"\u003eSvita.cz\u003c/a\u003e \u003ca href=\"https://www.maptiler.com/copyright/\" target=\"_blank\"\u003e\u0026copy; MapTiler\u003c/a\u003e \u003ca href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\"\u003e\u0026copy; OpenStreetMap contributors\u003c/a\u003e",
|
|
style: 'https://api.maptiler.com/maps/28280352-f69a-45fd-8dd7-2f178d7ed64f/style.json?key=lFBi7gs1S6TyJPtVVvOX'
|
|
}).addTo(map);
|
|
}
|
|
var marker = L.marker([<?php echo $prochazka['lat'] . ','. $prochazka['lon']; ?>]).addTo(map);
|
|
</script>
|
|
|
|
|
|
<?php
|
|
echo render('_footer');
|