maplibre / maplibre-style-spec

MapLibre Style Specification & Utilities
https://maplibre.org/maplibre-style-spec/
Other
68 stars 57 forks source link

Design proposal: Support for refreshTiles per tile source #61

Open pramilk opened 1 year ago

pramilk commented 1 year ago

Updated Proposal

Motivation

Currently map.options provide a property refreshExpiredTiles (default true). This applies to all tile sources.

Not all tile sources need to be refreshed and currently there is no way to override the map.options.refreshExpiredTiles per tileSource. In our use case on Bing maps only Traffic tiles need to be refreshed and no other tiles irrespective of the caching header needs to be refreshed.

Proposed Change

API Modifications

Migration Plan and Compatibility

Both design options described above adds an optional property and thus are backward compatible.

HarelM commented 1 year ago

Thanks for taking the time to write this! I think there are two different aspects here that are mixed a bit:

  1. Allow more granularity for refreshing tiles
  2. Improve performance in web.

While the second point is interesting I think we should focus on the first point. We can also argue in favor of the first point that allowing it will allow improving performance in web implementation (for some cases).

So I would like to try and focus the discussion around the spec, use cases, alternatives etc without getting into implementation details ATM.

pramilk commented 1 year ago

My primary motivation for this change is to improve performance of raster tiles. #1(granularity for refreshing tiles) is the only way I see it can be achieved and it additionally helps with having better control on which set of tiles require refresh.

Basically, if a tile source does not need a refresh then we don't care about its cache headers and thus HTMLImageElement can be used.

1 in itself will help

What is the additional input/data required to move forward from here? I have put in 2 options in design proposal. My preference is Option 2, but Option 1 also fine for our scenarios.

zhangyiatmicrosoft commented 1 year ago

option 1 seems easier. @HarelM what's your suggestion?

wipfli commented 1 year ago

@pramilk since the style specification is independent of MapLibre GL JS in the sense that we also use it in MapLibre GL Native, I think it would be good if you could rewrite the design proposal in such a way that it does not reference javascript or web specific things like HTMLImageElement or the fetch API.

wipfli commented 1 year ago

The idea is cool, we just have to make the motivation a bit more generic such that we know what to do in Native...

HarelM commented 1 year ago

In theory, raster tiles performance improvements can probably be achieved using other "tricks", so I agree with @wipfli, the discussion should be about the spec and be platform independent.

pramilk commented 1 year ago

Sure will update the proposal.

pramilk commented 1 year ago

Sorry for the delay. I have updated proposed design above and have removed any implementation details.

Given that this change is also in TileJSON, if everyone is OK with this change, shall I go ahead and propose the changes to TileJON spec?

HarelM commented 1 year ago

We believe the spec to be abandoned in terms of maintenance, we need to understand what are our next steps related to this spec (and probably the mbtiles as well). This proposal and the other one will be discussed in the technical steering committee I believe.

ovivoda commented 1 year ago

As discussed in the TSC meeting on 12'th of April, the proposal is generally approved

Action points:

ovivoda commented 1 year ago

Also from TSC a note from Minh Nguyễn:

An API setting could be complementary to something in TileJSON or style JSON. It would allow the MapLibre Navigation SDK to synchronize refreshing of the route data (which includes traffic) and basemap traffic, avoiding user confusion.