The main issue that stands out is the absence of template arguments in your sample options.
Your URL template string includes 5 additional attributes: year
, month
, day
, hour
, and minutes
. These need to be included in the TileLayer
options. The tile server seems to require two-digit numbers for these attributes, so make sure you input them in the correct format. Here's an illustration:
L.tileLayer('http://weatheroo.net/radar/data/{year}/{month}/{day}/{hour}/{minute}/{z}/{x}/{y}.png', {
detectRetina: false,
minZoom: 1,
maxZoom: 6,
minNativeZoom: 1,
maxNativeZoom: 6,
zIndex: 830,
className: 'tiles_radar',
crossOrigin: false,
year: "2019",
month: "07",
day: "14",
hour: "18",
minute: "40",
bounds:[
new L.LatLng(45.530, 1.07006),
new L.LatLng(55.7750629, 17.095451751)
]
})
If you require dynamic values for the above attributes, you can utilize a function to fetch the necessary values. Here's an example that utilizes the current date and time, formatting relevant ones with two digits to construct the tile URL:
L.tileLayer('http://weatheroo.net/radar/data/{year}/{month}/{day}/{hour}/{minute}/{z}/{x}/{y}.png', {
detectRetina: false,
minZoom: 1,
maxZoom: 6,
minNativeZoom: 1,
maxNativeZoom: 6,
zIndex: 830,
className: 'tiles_radar',
crossOrigin: false,
year: () => (new Date()).getFullYear().toString(),
month: () => `0${((new Date()).getMonth() + 1)}`.slice(-2),
day: () => `0${((new Date()).getDate())}`.slice(-2),
hour: `0${((new Date()).getHours())}`.slice(-2),
minute: `0${((new Date()).getMinutes())}`.slice(-2),
bounds:[
new L.LatLng(45.530, 1.07006),
new L.LatLng(55.7750629, 17.095451751)
]
})
Additionally, please note that weatheroo.net
does not support https. However, jsfiddle redirects all tile URLs to https. Consequently, even after adjusting the options, the example will not work on jsfiddle. Consider trying it locally or with another service.