mapbox / mapbox/mapbox-gl-js

Allow image source without image/coordinates

Open
#10,802 2 comments 0 reactions 1 assignee View on GitHub

@ryanhamley is already working on this.

Since Jul 12, 2021.

good first issue
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

## Motivation

I often use this pattern for GeoJSON sources:

1. addSource('mysource', { type: 'geojson', data: { type:'FeatureCollection', features: [] }});
2. addLayer({ id: 'mylayer', source: 'mysource' })
3. Now fetch the actual data, manipulate it, and call setData() to set it.

I do this because:

- I need to fetch the data asynchronously (but I don't want to hold up all my other init)
- I want the layer to be in a predictable place in the style (which I wouldn't get if I waited for the data to load before creating the source and the layer).

This doesn't work with the Image type because you have to provide some kind of actual data.

It would be more flexible thus if the `image` type didn't require data, like the `geojson` type.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.