I'm trying to use the Wikipedia layer in english: http://mappingforyou.eu/javascript/Leaflet.Wikipedia.js
but I'm not successful on using the leaflet infotips "BindPopup". The code could be working with a sidebar, but I prefer infotips. Can you correct the line for me please?
function onMoveEnd(evt) {
var template = '<h2>{label}</h2><p><img src="{thumbnail}"><br>{abstract}</p><p><a href="{link}">Read on Wikipedia</a></p>';
L.wikipedia({
query: {
fields: ['label', 'lat', 'lng', 'abstract', 'link', 'thumbnail'],
bounds: map.getBounds()
},
marker: {
icon: L.icon({ // Icons from http://www.icondrawer.com/social-icons.php
iconUrl: 'https://mappingforyou.eu/icons2/wikipedia_16.png',
iconRetinaUrl: 'https://mappingforyou.eu/icons2/wikipedia_32.png',
iconSize: [16, 16]
})
}
}).addTo(map).on('click', function (evt) {
evt.layer.bindPopup((template), {maxWidth: 200, maxHeight: 200});
});
}
map.on('moveend', onMoveEnd);