Skip to content

Update leaflet.timedimension.js#1

Open
ev4debug wants to merge 2 commits into
masterfrom
ev4debuglayers_with_limited_bounds_fix
Open

Update leaflet.timedimension.js#1
ev4debug wants to merge 2 commits into
masterfrom
ev4debuglayers_with_limited_bounds_fix

Conversation

@ev4debug

Copy link
Copy Markdown
Owner

When one or more layers with limited bounds are out the visible map, isReady(time) never return true.

with this code:
var URL='http://thredds.emodnet-physics.eu/thredds/wms/fmrc/SOCIBlast60days/Socib_Last_60_Days_Socib_HFRadar?'
var radarSource = new L.tileLayer.wms(URL, {
layers: 'sea_water_velocity',
format: 'image/png',
transparent: true,
colorscalerange: '0,0.75',
abovemaxcolor: "extend",
belowmincolor: "extend",
bounds: L.latLngBounds(["38.323", "0.50384"], ["39.1067", "1.40066"]),
}).addTo(map);
var radarTimeLayer = L.timeDimension.layer.wms(radarSource, {
updateTimeDimension: true,
name: 'sea_water_velocity',
units: "m/s",
}).addTo(map);

when the visible bounds (map.getBounds()) does not contains L.latLngBounds(["38.323", "0.50384"], [["39.1067", "1.40066"]), isReady is always false

ev4debug added 2 commits July 13, 2016 12:41
When one or more layers with limited bounds are out the visible map, isReady(time) nevere return true.

with this code:
	var URL='http://thredds.emodnet-physics.eu/thredds/wms/fmrc/SOCIBlast60days/Socib_Last_60_Days_Socib_HFRadar?'
	var radarSource = new L.tileLayer.wms(URL, {
		layers: 'sea_water_velocity',
		format: 'image/png',
		transparent: true,
		colorscalerange: '0,0.75',
		abovemaxcolor: "extend",
		belowmincolor: "extend",
		bounds: L.latLngBounds(["38.323", "0.50384"], ["39.1067", "1.40066"]),
	}).addTo(map);
	var radarTimeLayer = L.timeDimension.layer.wms(radarSource, {
		updateTimeDimension: true,
		name: 'sea_water_velocity',
		units: "m/s",
	}).addTo(map);

when the visible bounds does not contains L.latLngBounds(["38.323", "0.50384"], [["39.1067", "1.40066"]), isReady is always false
…nction

inserted the bounds check in "L.TimeDimension.Layer.WMS.isReady" function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant