Skip to content

Instantly share code, notes, and snippets.

@0xack13
Last active August 29, 2015 14:06
Show Gist options
  • Save 0xack13/02806440db2369a5fe81 to your computer and use it in GitHub Desktop.
Save 0xack13/02806440db2369a5fe81 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='//code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<link rel="stylesheet" type="text/css" href="http://leafletjs.com/dist/leaflet.css">
<script type='text/javascript' src="https://dl.dropboxusercontent.com/u/620583/leaflet-src.js"></script>
<style type='text/css'>
</style>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$(document).ready(function() {
var stops = [{"id":"STOP_16315","value":{"id":"STOP_16315","name":"16315","desc":"","lat":19.373452048047675,"lon":-99.17837977409363}},{"id":"STOP_15233","value":{"id":"STOP_15233","name":"Calzada Ermita Iztapalapa - 2 De Abril","desc":"","lat":19.342406968985642,"lon":-99.0522837638855}}];
var map = L.map('map').setView([19.342,-99.047], 13);
var overlay = L.featureGroup().addTo(map);
for(s in stops) {
var stop = stops[s];
L.marker([stop.value.lat, stop.value.lon], {riseOnHover: true}).addTo(overlay);
}
// uncomment me to fix problem or remove the above setView call.
//sleep(1000);
map.fitBounds(overlay.getBounds());
});
});//]]>
</script>
</head>
<body>
<div style="height: 500px; width: 500px;"id="map"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment