mapbox / mapbox/leaflet-image

imageOverlay not supported

Open
#59 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
380
Forks
140
PR merge metrics
No merged PRs in 30d

Description

I tried adding imageoverlay, but it doesn't seem right. Any help? Thx!
CC: @jieter

``` lang=javascript
function drawTileLayer(l) {
if (l instanceof L.TileLayer) layerQueue.defer(handleTileLayer, l);
else if (l instanceof L.ImageOverlay) layerQueue.defer(handleImageOverlay, l);
else if (l._heat) layerQueue.defer(handlePathRoot, l._canvas);
}
...
function handleImageOverlay(imgOverlay, callback) {
var imgBounds = imgOverlay.getBounds(),
bounds = new L.Bounds(
map.latLngToLayerPoint(imgBounds.getNorthWest()),
map.latLngToLayerPoint(imgBounds.getSouthEast())),
size = bounds.getSize();
var ctx = canvas.getContext('2d');
ctx.drawImage(imgOverlay._url, bounds.min.x, bounds.min.y, size.x, size.y);
callback(null, { canvas: canvas });
}
```

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.

Research direction

Start with drawTileLayer and handleImageOverlay in the issue example, then compare the ImageOverlay path with the existing TileLayer handling. Determine what is wrong with the current image-overlay rendering and verify that an overlay appears correctly in the generated image.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.