For some reason I'm getting undefined
in the console, but I'm not sure why.
var mp = document.getElementById('map'), ms = mp.style, center = L.latLng(47.62, -122.3321), h = innerHeight-130;
var tl = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'});
ms.height = h+'px';
var map = L.map('map', {center:center, zoom:10, layers:[tl]});
// remove when deployed
map.on('click', function(e){
console.log(e.latLng);
});
Yet, if I change console.log(e.latLng)
to console.log(e)
, I'm seeing a result. According to their own documentation, it should work. Why doesn't it?