Closed luisfio1 closed 4 months ago
I don't fully understand your question, but i will try:
The event will trigger in the map
container, so, you have to add a listener to you map instance like this:
map.on("bfl:layerloaded", (ev) => {
console.log("Your file was read successfully!! Event: ", ev);
});
Also, the plugin will add your layer into map automatically.
Try this:
map.on('bfl:layerloaded', function (event) {
layerswitcher.addOverlay(event.layer, event.filename);
});
I want to add the new file, opened with BFL to L.control.layers, using: // Better-FileLayer var fileLayer = L.Control.betterFileLayer( options = { style: () => myStyle,
}, ).addTo(map);
But it does not work. Which would be the correct function?