Combine loadImage and addImage
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
It's not the end of the world, but I find this pattern clunky and hard to remember:
```
map.loadImage('assets/images/marker.png', (error, image) => {
map.addImage('marker', image);
});
```
It could just as easily be:
```
map.addImage('marker', 'assets/images/marker.png');
```
I would have thought that the primary use case for `addImage` is fetching an image specifically for the purpose of adding it to the map, rather than using some existing image that happens to exist in the DOM.
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 tracing the existing loadImage and addImage entry points and their public API behavior. Compare how each handles image URLs, loading errors, and already available images; the work is done when the proposed combined call has clear behavior and corresponding coverage or documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, 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
- 35/100