in

Leaflet JS getBound to TileLayer


I have a web site to displaying historic maps. The maps have been tiled and are loaded as a tilelayer. Is there a way to getBound so I can set the map with fitBound. By default tilelayer does not have a getBounds method. I have tried making a featureGroup of the layer but that just raises an error. Am I missing something? Thanks.

// Initiate map
var map = new L.Map('map', {minZoom: 8, maxZoom: 18, zoom: 10}); 

// Display and set boundary
var layer = new L.TileLayer('../../maps/1866/{z}/{x}/{y}.png',{maxNativeZoom: 17});

//create featuregroup
var fgroup = new L.featureGroup([layer]);
fgroup.addTo(map);
map.fitBounds(fgroup.getBounds());





Source: https://stackoverflow.com/questions/70538166/leaflet-js-getbound-to-tilelayer

HERE’S WHY EMMA WATSON ALMOST QUIT HARRY POTTER

Experimental test runner based on vite