Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Can't override xml-provided source using the constructor opts

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
backend

Research direction

Start at index.js around line 80 and trace how constructor options are combined with the XML-provided source, comparing this with the handling of scale and format. Confirm that an explicitly provided constructor source takes precedence over the XML source, while existing behavior remains unchanged for other options.

Written by the indexing model from the issue text.

Description

It's not possible (or if it is, not obvious how!) to override the source provided in the xml. This would be useful, for example, when using a style generated by tm2, but serving the vector tiles from a local cache on a non-networked device.

With the options passed to the constructor, the source is handled differently from other options, such as scale and format. The xml-provided values for these can be overridden in the constructor opts, but the reverse happens for source - the xml value overrides any source provided in the constructor.

https://github.com/mapbox/tilelive-vector/blob/4969f7af2c0490a7bb7ac80c95eddab49f3b5ed6/index.js#L80

I think if a source is provided in the constructor, then it should override the source in the xml, as per the behaviour of scale and format.

Dominant language
JavaScript
Stars
72
Forks
42
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/tilelive-vector

All issues in mapbox/tilelive-vector

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.