Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multiple URLs for DemSource #71

Open
flemmens opened this issue Sep 19, 2023 · 1 comment
Open

Adding multiple URLs for DemSource #71

flemmens opened this issue Sep 19, 2023 · 1 comment

Comments

@flemmens
Copy link

Thanks for this great plugin :)

When initializing a new DemSource, would it be possible to provide an array of URLs in order to speed up the process with parallel download the same way it is done for regular sources in MapLibre ?

this.demSource = new mlcontour.DemSource({
  url: [
    "https://tiles1.mysource.com/folder/{z}/{x}/{y}.png",
    "https://tiles2.mysource.com/folder/{z}/{x}/{y}.png",
    "https://tiles3.mysource.com/folder/{z}/{x}/{y}.png",
    "https://tiles4.mysource.com/folder/{z}/{x}/{y}.png"
  ],
  encoding: "terrarium",
  maxzoom: 14,
  worker: true,
  cacheSize: 100,
  timeoutMs: 10000
})

Thank you.

@msbarry
Copy link
Contributor

msbarry commented Sep 22, 2023

Thanks for reaching out. This plugin could replicate all tile fetching functionality from maplibre (multiple urls, tilejson, custom protocols, callbacks to transform the request, etc.) but that adds quite a bit to the plugin size and complexity and will be a moving target as maplibre evolves. A better route might be to expose an API from maplibre that lets you fetch a tile from a source that it knows about?

Also regarding this specific request, are your tiles served over http/1.1 or http/2? If they are served over http/2 then the multiple urls shouldn't be necessary since http/2 doesn't cap at 6 connections per domain like 1.1 did.

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

No branches or pull requests

2 participants