Skip to content

Add a Marker

Leaflet markers, popups, and overlays work as usual on top of the vector basemap layer.

import { MaptoolkitLogoControl } from 'https://cdn.jsdelivr.net/npm/@maptoolkit/leaflet-logo/+esm';
const map = L.map('map').setView([52.52, 13.405], 13);
L.maplibreGL({ style: 'https://styles.maptoolkit.org/summer.json'}).addTo(map);
L.marker([52.52, 13.405]).addTo(map);
new MaptoolkitLogoControl().addTo(map);
map.attributionControl.setPrefix(false);
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css" />
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.css" />
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/maplibre-gl.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/@maplibre/[email protected]/leaflet-maplibre-gl.js"></script>
  <style>
    html, body { width: 100%; height: 100%; margin: 0; padding: 0; }
    #map { width: 100%; height: 100%; }
  </style>
</head>
<body>
  <div id="map"></div>
  <script type="module">
import { MaptoolkitLogoControl } from 'https://cdn.jsdelivr.net/npm/@maptoolkit/leaflet-logo/+esm';
const map = L.map('map').setView([52.52, 13.405], 13);
L.maplibreGL({ style: 'https://styles.maptoolkit.org/summer.json'}).addTo(map);
L.marker([52.52, 13.405]).addTo(map);
new MaptoolkitLogoControl().addTo(map);
map.attributionControl.setPrefix(false);
  </script>
</body>
</html>