Map#getLayer should return the serialized representation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
The type currently returned by `Map#getLayer` is private and has no documented methods. The only documented thing you can do with it is check if it's `null` or not. This isn't very useful. It would be more useful to return the _serialized_, style spec representation of the layer.
However, this implies that `Map#getSource` should also return the serialized representation, rather than the internal object. In this case though, we do document things such as `GeoJSONSource#setData`, which has no `Map`-level equivalent.
We need to commit one way or the other with these APIs. Mixing and matching behavior is confusing.
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 by reviewing the Map#getLayer and Map#getSource API entry points and their documentation, then compare the documented GeoJSONSource#setData behavior. Done means choosing and documenting a consistent serialized-versus-internal representation for these APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100