diff --git a/app/Presentation/Home/default.latte b/app/Presentation/Home/default.latte
index 6dd309f..3942ff7 100644
--- a/app/Presentation/Home/default.latte
+++ b/app/Presentation/Home/default.latte
@@ -4,7 +4,8 @@
Seznam obvodů
\ No newline at end of file
diff --git a/app/Presentation/Obvody/ObvodyPresenter.php b/app/Presentation/Obvody/ObvodyPresenter.php
index 5938f44..c724062 100644
--- a/app/Presentation/Obvody/ObvodyPresenter.php
+++ b/app/Presentation/Obvody/ObvodyPresenter.php
@@ -15,6 +15,6 @@ final class ObvodyPresenter extends Nette\Application\UI\Presenter
public function renderDefault(int $obvod = null): void
{
-
+ $this->template->obvod_id = $obvod;
}
}
diff --git a/app/Presentation/Obvody/default.latte b/app/Presentation/Obvody/default.latte
index 493322f..029a1c5 100644
--- a/app/Presentation/Obvody/default.latte
+++ b/app/Presentation/Obvody/default.latte
@@ -3,6 +3,9 @@
{block content}
+
diff --git a/www/js/mapa.js b/www/js/mapa.js
index 7bdbf8b..5a2dbeb 100644
--- a/www/js/mapa.js
+++ b/www/js/mapa.js
@@ -36,7 +36,7 @@ var osm = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
// Výchozí bod:
var map = L.map('map', {
- center: [50.853501146, 14.8425],
+ center: [50.853501146, 14.8425], // Hrádek
zoom: 16,
layers: [mapyCZ, osm]
});
diff --git a/www/js/obvody.js b/www/js/obvody.js
index 0035110..cd59fb1 100644
--- a/www/js/obvody.js
+++ b/www/js/obvody.js
@@ -12,11 +12,22 @@ $.ajax({
var geojson;
geojson = L.geoJSON(geojsonFeature, {
style: style,
+ filter: picnicFilter,
onEachFeature: onEachFeature
}).addTo(map);
+function picnicFilter(feature) {
+ // obvod ID je z latte obvod_id
+ if (obvod_id == null) return true;
+ if (feature.properties.number == obvod_id) return true
+}
+
+// center na vybraný obvod:
+map.flyToBounds(geojson.getBounds());
+
+
// geolokace:
-map.locate({ setView: true, maxZoom: 16 });
+map.locate({ setView: false, maxZoom: 16 });
function onLocationFound(e) {
var radius = e.accuracy;