I have leafletmap with group of Stations in asp.net project. I want when i click on the station from the list some processes to start. That part is working fine, but after that i have a postback. Is there a way to remember the clicked station(can be id or number) and then to click it again dynamically?
Actually all i want is that selected layer from the list to be selected again after the postback.
The code for starting these Processes in c#:
mymap.on('baselayerchange', function (eventLayer) {
var selectedLayer = eventLayer.layer;
var id = selectedLayer._leaflet_id;
id = id - 1;
var el = selectedLayer._layers[id]._popup._content;
var slug = el.split('ID=').pop();
var hdnfldVariable = document.getElementById('MainContent_hdnfldVariable');
hdnfldVariable.value = slug;
document.getElementById("MainContent_Btn").click();;
});
I add the id of the current station in HiddenField which is used after that and then press that Button which start all the processes in the c# code. Everything else is working fine , just when all of these processes are done, there is postback and after that from the list "Show all" is selected.
Thanks :)