Trouble trying to create a Tileset Source.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 768
- Forks
- 191
- PR merge metrics
- No merged PRs in 30d
Description
Hi !
I'm trying to use the [createTilesetSource ](https://github.com/mapbox/mapbox-sdk-js/blob/main/docs/services.md#createtilesetsource) function in the services section, and it returns me an error:
`No file data in request. Expected 1 file named "file".`
I'm using it like that :
```javascript
import MapboxTilesets from "@mapbox/mapbox-sdk/services/tilesets";
const tilesetsClient = MapboxTilesets({ accessToken });
```
and
```javascript
async CreateTilesetSource() {
console.log("Create A Tileset Source");
const tilesetId = "newTileSet";
const data = await this.GetJsonFile();
const geoJsonData = GeoJson.parse(data, { Point: ["lat", "lng"] });
const blobFile = new Blob([geoJsonData], { type: "application/json" });
return new Promise((resolve) => {
tilesetsClient
.createTilesetSource({
id: tilesetId,
file: blobFile,
})
.send()
.then((res) => {
const tilesetSource = res.body;
console.log(tilesetSource);
})
.catch((res) => {
console.log("--- CATCH ERROR ! ---");
console.log(res.message);
resolve(null);
})
.done();
});
}
```
Thank you in advance ! : )
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docs/services.md at the createTilesetSource entry and reproduce the supplied browser example using a Blob. Inspect how createTilesetSource handles the file argument and compare that with the request's expected file field. Done means the reported example either succeeds or the required input and limitation are clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100