Leaflet / Leaflet/Leaflet.VectorGrid

Cancelling requests

Open
#136 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
676
Forks
202
PR merge metrics
No merged PRs in 30d

Description

I've noticed that when using protobuf and changing the zoom, old requests aren't cancelled. This is sometimes clogging the server if the tiles take too long and the user changes zoom quick.

If it is of any help, in leaflet tile layers this is handled by changing the src of the img and that makes the browser cancel the old request https://github.com/Leaflet/Leaflet/blob/master/src/layer/tile/TileLayer.js#L230

Of course that won't work out here, since you are doing fetch directly.

Thanks

Contributor guide

No contributing guide indexed for this repository

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 by tracing the protobuf tile fetch entry point and compare its request handling with Leaflet's linked src change in TileLayer.js. Verify the behavior while changing zoom rapidly; done means obsolete tile requests are cancelled so they no longer continue clogging the server.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.