I am using leaflet to draw a map and then insert a lot of markers on it afterwards. The markers come out nicely, I have a custom icon for them, but I can't get any of the popups to work with .bindPopup(). I get no errors either.
Here is my code:
var map = L.map('map').setView([60.20, 24.92], 11);
L.tileLayer('https://ssl_tiles.cloudmade.com/<APIKEY>/997/256/{z}/{x}/{y}.png', {
attribution: '',
maxZoom: 18
}).addTo(map);
function setLeafletMarker() {
var markerLocation = new L.LatLng(60.2, 24.8);
var marker = new L.Marker(markerLocation);
map.addLayer(marker);
marker.bindPopup("<b>Hello world!</b><br />I am a popup.")
}
$(document).ready(function () {
setLeafletMarker()
}