Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>Audio Demo</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript" src="leaflet.ajax.js"></script>
<style type="text/css">
html {
height: 100%;
}
body {
height: 100%;
}
#map {
height: 95%;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
var map = L.map('map').setView([34, -100], 4);
var audioIcon = L.icon({
iconUrl: 'audio.png',
iconSize: [32, 37],
shadowSize: [0, 0],
iconAnchor: [16, 37],
shadowAnchor: [0, 0],
popupAnchor: [0, -37]
});
function onEachAudio(feature, layer) {
layer.bindPopup(feature.properties.name + "<br>" + feature.properties.html);
};
new L.GeoJSON.AJAX("audio.geojson", {
onEachFeature: onEachAudio,
pointToLayer: function(feature, latlng) {
return L.marker(latlng, {icon: audioIcon});
}
}).addTo(map);
L.tileLayer('http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.png',
{
attribution: '<a href="http://maps.stamen.com/">Stamen base map</a>',
maxZoom: 18
}).addTo(map);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment