Giter VIP home page Giter VIP logo

Comments (4)

thezealousfool avatar thezealousfool commented on August 18, 2024 1

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.

thezealousfool avatar thezealousfool commented on August 18, 2024

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.

mactrem avatar mactrem commented on August 18, 2024

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.

lseelenbinder avatar lseelenbinder commented on August 18, 2024

Fixed in #87. Thanks @lights0123!

from maplibre-gl-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.