Skip to content

Respect show in TimestampedWmsTileLayers - #2386

Open
VolodymyrLinuxovich wants to merge 1 commit into
python-visualization:mainfrom
VolodymyrLinuxovich:timestamped-wms-show
Open

VolodymyrLinuxovich wants to merge 1 commit into
python-visualization:mainfrom
VolodymyrLinuxovich:timestamped-wms-show

Conversation

@VolodymyrLinuxovich

Copy link
Copy Markdown

TimestampedWmsTileLayers always added each wrapped WMS layer to the map. It ignored the show option of that layer. So a WmsTileLayer created with show=False was still visible when the map opened. Its box in the LayerControl was ticked too.

The time layer is now only added to the map when the WMS layer has show=True. With show=False it stays in the LayerControl and can be turned on from there.

I added a test for both cases. It fails on main.

@nk-batman21

Copy link
Copy Markdown
Contributor

I tested the all-hidden startup case in Chrome with a local WMS serving three dates. On the base (e06e8fe), the show=False overlay started checked and immediately made a GetCapabilities request and tile requests. On f349464, it started unchecked with zero WMS requests.

I also checked the first activation, since the time control starts with no dates in this setup. Checking the overlay fetched GetCapabilities once and populated all three dates. Selecting the last date moved the clock to January 3 and sent TIME=2020-01-03T00:00:00.000Z in GetMap. Unchecking the overlay removed all its tile images. This worked without supplying time_interval to TimestampedWmsTileLayers.

@VolodymyrLinuxovich

Copy link
Copy Markdown
Author

Thanks for testing this so carefully. Good to know the first activation works without time_interval too.

This branch has not been deployed

No deployments
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.

2 participants