mapbox / mapbox/mapbox-gl-js

`map.setLayoutProperty('layerID', 'visibility', 'none')` will trigger duplicate http request

Open
#7,459 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance :zap:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: 0.49.0

### Question
simple hidden a raster layer `map.setLayoutProperty('layerID', 'visibility', 'none')` will duplicate http request`
### **Is it a special feature or something need improved?**

### step
1. add a raster layer with google map source.and clear network console
![image](https://user-images.githubusercontent.com/17786362/47284571-6feb8580-d61a-11e8-8471-254f4c0040c6.png)

2. hidden raster layer by `map.setLayoutProperty('layerID', 'visibility', 'none')`,and you will find it trigger duplicate http
![image](https://user-images.githubusercontent.com/17786362/47284697-e2f4fc00-d61a-11e8-8b96-ee94ab62888f.png)

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

Reproduce the issue in mapbox-gl-js 0.49.0 with a raster layer backed by the Google map source, then call map.setLayoutProperty('layerID', 'visibility', 'none') while watching the network console. Trace the visibility update and raster request handling; done means hiding the layer does not trigger a duplicate HTTP request.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
networking, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.