Skip to content

Instantly share code, notes, and snippets.

@hhkaos
Created January 26, 2021 09:47
Show Gist options
  • Save hhkaos/38ba755514f5ffedb4a8ae79a5272925 to your computer and use it in GitHub Desktop.
Save hhkaos/38ba755514f5ffedb4a8ae79a5272925 to your computer and use it in GitHub Desktop.
Simple svg map
<html>
<head>
<style>
#map {
height: 400px;
}
</style>
<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"></div>
<script>
// create the map
var map = L.map('map', {
center: [40.75, -74.2],
zoom: 13
});
var imageUrl = 'https://www.amcharts.com/lib/3/maps/svg/australiaHigh.svg',
imageBounds = [
[40.712216, -74.22655],
[40.773941, -74.12544]
];
L.imageOverlay(imageUrl, imageBounds).addTo(map);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment