elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.81k stars 8.2k forks source link

tile raster layer doesn't give the source granular control over when updates can be skipped #139429

Closed desean1625 closed 2 years ago

desean1625 commented 2 years ago

Kibana version: 8.4

Describe the bug: canskipupdate does not allow the source to control when an update can be skipped. preventing 3rd party plugins from updating the tiles when the plugin determines is needed.

Steps to reproduce:

  1. Create custom map layer using the 3rd party map plugin
  2. zoom in and out on map and allow the tileserver to rerender tiles based on the zoom level

Expected behavior: expect geturltemplate to fire on every map moves and zooms.

elasticmachine commented 2 years ago

Pinging @elastic/kibana-gis (Team:Geo)

desean1625 commented 2 years ago

I think that it is more than just the extent. There is currently no way for a custom source to override the canskip data sync. So any style changes or layer changes never get applied . Each layer type controls the datasync canskip, and 3rd party map plugins cannot override that.

Basic use case create NOAA weather, in the SourceSettingsEditor have a drop down that allows you to change between the layers radar_meteo_imagery_nexrad_time and sat_meteo_emulated_imagery_lightningstrikedensity_goes_time. That change never triggers a forced refresh, and the canSkipSourceUpdate in the raster layer says nope we dont need to update so the radar image never updates from nexrad to lightningstrikes.

I think that if we add a new method to the ISource interface called 'canSkipDataSync' then the source can control when to do a data sync, add that method to the AbstractLayer and always return true. Then in the raster layer check canskip & source.canSkipSourceUpdate()

desean1625 commented 2 years ago

Pull request that fixes the issue and allows the get url template to change based on the source requirements. # #139577

desean1625 commented 2 years ago

@nreese @nickpeihl Also could we have the raster tile layer check with the source to determine if the layer is stale and needs to be removed. Currently the raster layer just checks if the url has changed this is causing the layer to be removed and readded causing a flash during zooms and pans for my current raster source.

desean1625 commented 2 years ago

I updated the PR to clean up how the raster layer determines if the source can skip the update and moved all of the logic into the source and out of the layer, and added an interface for ITMSSource to determine if the source is stale and moved the base TMS source logic out of the layer and into the tms_source.

An example API that this would be needed for would be https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-base-maptile.html#resource-base-maptile__includes-query-parameters changing the optional query parameters

Please review https://github.com/elastic/kibana/pull/139577/commits/7d2aebbb09d59309e5a899debc73902ee4331ec3 and let me know if this works with the architecture that you envision.

nickpeihl commented 2 years ago

Fixed by #141829