Skip to content

Instantly share code, notes, and snippets.

@mapsmania
Created May 12, 2018 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapsmania/904e68e1b45327bf102d82784e985197 to your computer and use it in GitHub Desktop.
Save mapsmania/904e68e1b45327bf102d82784e985197 to your computer and use it in GitHub Desktop.
Railways of India
<!DOCTYPE html>
<html>
<head>
<title>antirubbersheet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<style>
html, body, #map {
margin: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id='map'></div>
<script>
var map = L.map('map', {
crs: L.CRS.Simple
});
var bounds = [[0,0], [1350,1228]];
var image = L.imageOverlay('https://i.imgur.com/4vXYq3t.jpg', bounds).addTo(map);
map.fitBounds(bounds);
L.marker([986,495]).addTo(map)
.bindPopup("Delhi");
L.marker([584,301]).addTo(map)
.bindPopup("Mumbai");
L.marker([728,926]).addTo(map)
.bindPopup("Kolkata");
L.marker([496,526]).addTo(map)
.bindPopup("Hyderabad");
L.marker([313,596]).addTo(map)
.bindPopup("Chennai");
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment