SignalK / freeboard-sk

Chartplotter implementation for Signal K servers
Apache License 2.0
35 stars 27 forks source link

Blank screen between mbtiles files when zooming in or out #137

Closed Merange closed 6 months ago

Merange commented 6 months ago

Hello,

Thank you very much for your nice work.

But I've some trouble with mbtiles. I've made 2 files, one for the large area with zoom from 1 to 10 and one with more accuracy from 11 to 17

When I look with zoom from 1 to 9.9, all is ok. If I go 11.0 and over, it's also nice, But zoom from 10.0 to 10.9 the screen is blank.

I can send to you some quite small sample of mbtiles if you want.

Thank you

image image image

panaaj commented 6 months ago

Based on the details you have provided, this is expected behaviour. Chart tiles are only when the display zoom level is within the chart's min & max zoom level values.

Your Large area chart has min-zoom = 1 and max-zoom = 10 and the more detailed chart has a min-zoom = 11 and max-zoom = 17. When the display zoom level >= 10 and < 11 both of your charts are outside their zoom levels and no tiles will be displayed.

Merange commented 6 months ago

I understand, but if I create a file with the tiles of zoom level 1 to 11 there is not blank screen. It a way a workaround (I try it), but in this case, I need to have the level 11 in the 2 files.

I don't know how you choose what level you display on zoom with decimal values in a unique mbtiles file. I suppose it is a round so 9.5<zoom<= 10.5 you display 10 and 10.5<zoom<=11.5 you display 11 and so on.

It seems to be the good way to manage zoom levels beteween files as you do for zoom levels in one file.

Thank you

panaaj commented 6 months ago

Can this issue be closed?

Merange commented 6 months ago

It depends on you.

The issue is present and the work mode is not consistent with the work mode in one file. For me, the consistent work mode will be, in my example from 10.0 to 10.5 display the charts from the 1-10 file and from 10.5 to 11 display the file with zoom from 11 to 17.

In other words, level 10 includes decimal levels from 9.5+ to 10.5 and level 11 is used for displaying level 10.5+ to 11.5, like the Math.round() method will do.

panaaj commented 6 months ago

The way in which tiles are displayed at various zoom levels are not part of the Freeboard code operation but rather the OpenLayers library operation. Any proposed change would need to be raised with OpenLayers.