Instantly share code, notes, and snippets.

Embed
What would you like to do?
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