I'm trying to write a simple file for testing Leaflet Plugin "Leaflet Custom Headers". Some discussion about the Plugin's purpose has been written here: https://github.com/Leaflet/Leaflet/issues/7560
I'm not into .ts-Scripting nor Packet manager-Installations. So I downloaded the Repo's zip-file and put its content into the same folder as my "test.htm". But the following code doesn't work, my Browser doesn't open the map. Any ideas to improve the code?
<!DOCTYPE html>
<html>
<head>
<title>Test with Leaflet Custom Headers</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
</head>
<body>
<div id="map" style="width: 800px; height: 600px;"></div>
<script defer src="main.ts"></script>
<script>
var map = L.map('map').setView([51.505, -0.09], 13);
var layerWithHeaders = new TileLayerHeaders(“https://tile.openstreetmap.org/{z}/{x}/{y}.png”, {
customHeaders: {
"Authorization": "MY_TEST_TOKEN"
}
});
layerWithHeaders.addTo(map);
</script>
</body>
</html>