14 lines
435 B
JavaScript
14 lines
435 B
JavaScript
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);
|
|
}
|
|
}
|