diff --git a/assets/controllers/map_controller.js b/assets/controllers/map_controller.js new file mode 100644 index 0000000..937af98 --- /dev/null +++ b/assets/controllers/map_controller.js @@ -0,0 +1,14 @@ +import { Controller } from '@hotwired/stimulus'; +import L from 'leaflet'; +import 'leaflet/dist/leaflet.min.css'; + +export default class extends Controller { + connect() { + const map = L.map(this.element).setView([51.0543, 3.7174], 13); + + L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors', + maxZoom: 19, + }).addTo(map); + } +} diff --git a/assets/styles/app.css b/assets/styles/app.css index dd6181a..a2a3ec5 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -1,3 +1,6 @@ body { background-color: skyblue; } + +html, body { height: 100%; margin: 0; } +.map-container { height: 100vh; width: 100%; } diff --git a/importmap.php b/importmap.php index 3179c47..d9eb2c2 100644 --- a/importmap.php +++ b/importmap.php @@ -27,4 +27,6 @@ return [ '@hotwired/stimulus' => ['version' => '3.2.2'], '@symfony/stimulus-bundle' => ['path' => './vendor/symfony/stimulus-bundle/assets/dist/loader.js'], '@hotwired/turbo' => ['version' => '8.0.23'], + 'leaflet' => ['version' => '1.9.4'], + 'leaflet/dist/leaflet.min.css' => ['version' => '1.9.4', 'type' => 'css'], ]; diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php new file mode 100644 index 0000000..488ac14 --- /dev/null +++ b/src/Controller/IndexController.php @@ -0,0 +1,16 @@ +render('index/page.html.twig'); + } +} diff --git a/templates/index/page.html.twig b/templates/index/page.html.twig index 3b7a864..51943aa 100644 --- a/templates/index/page.html.twig +++ b/templates/index/page.html.twig @@ -1,16 +1,6 @@ - - - Test - - -

Rater

- {{ form(form) }} +{% extends 'base.html.twig' %} -

Existing

- - - +{% block body %} +

Rater

+
+{% endblock %}