I am writing a blog with html, php and javascript about my travels. I have a classical menu in which I choose a country. That links me to a new page with an article about this country.
I would like to change it like this : I have a map with a marker for each country I went to. I would like to click on the marker to move to the corresponding page.
In my javascript I have my map and my markers :
var map = L.map('mapid').setView([25, 22], defaut_zoom);
var carte="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"
L.tileLayer(carte, {
attribution:'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'}).addTo(map);
var finlande = L.marker([60.1698,24.93837],{icon: satIcon}).addTo(map);
var pouce = L.marker([47.50075,9.742309999999975]).addTo(map);
//I tried to use an EventListener :
finlande.addEventListener('click',function (event) {
event.preventDefault();
document.getElementById("lien");
});
})
it links to my php file :
<img id=lien><a href="finlande.html">
But it does not work. I have some basics in javascript but I have to admit that I get confused with what I can do in js and what I should do in html or php. Thank you in advance for help !