Comments (4)
I was testing the PR. I faced some problem trying to add geojson source after an image source. Would be nice if someone else can confirm that the problem can be reproduced.
geojson
.then(json => {
this.addSource("ref_img", {
"type": "image",
"url": "/static/test.png",
"coordinates": bbox
});
this.addSource("ref_points", {
"type": "geojson",
"data": json,
})
this.addLayer({
"id": "ref_img",
"type": "raster",
"source": "ref_img",
});
this.addLayer({
"id": "ref_points",
"type": "circle",
"source": "ref_points",
"paint": { "circle-radius": ["interpolate", ["linear"], ["zoom"], 8, 1, 22, 20] },
});
})
version 1.13.0-rc.3 renders the points correctly but of-course does not work on Firefox. With the PR, I can only see the image. My guess is that the points layer is being added first before the request animation frame and then the image layer on top of that so I do not see the points layer anymore.
In summary, I think, the request animation frame can lead to wrong layer ordering. Please correct me if I am wrong.
Thank You
from maplibre-gl-js.
Can this PR be merged? The change is not a big one to sit over a month on. Thank You @lights0123 for bringing this up.
from maplibre-gl-js.
The requestAnimationFrame callback is only responsible for releasing the image to avoid memory leaks, so it can't have any impact on the layer ordering. Tested your sample under a current version of firefox and it works for me.
from maplibre-gl-js.
Fixed in #87. Thanks @lights0123!
from maplibre-gl-js.
Related Issues (20)
- MapLibre stops responding with weird, seemingly unrelated error message HOT 2
- Sustitute placeholder images from placekitten.com
- Ability to modify the map background HOT 1
- setLayoutProperty trigger blink of map layer HOT 2
- Add the actual projection matrix to transform HOT 5
- Is it time to move to ES2017 and how HOT 4
- preserveDrawingBuffer and marker dragging breaks down rendering HOT 2
- Geojson Circle broken / even on example page HOT 8
- Extrusion line geometry HOT 4
- Map makes unnecessary repeated requests against a source's tile HOT 11
- Add `getData` method for GeoJSON sources. HOT 5
- Image source is clipped to -180,180 when terrain is enabled. HOT 13
- Map.flyTo padding not being cleared -> fitBounds is summing it up with it's own padding argument HOT 1
- drag to rotate breaks if the maps bearing/pitch is changed inside of a move event HOT 3
- Markeroptions type misleading HOT 1
- CustomHandler best practices HOT 2
- Smooth virtual dom integration for html markers HOT 1
- Hash is not synced with map position when terrain is enabled. HOT 2
- Incorrect Positioning of Intermediate Points When Drawing Polygons HOT 2
- Is it possible to use terrain data in a custom style layer to shade the map?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maplibre-gl-js.