Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add control blocked while unassociated layer tiles are loading #1205

Open
nreese opened this issue Nov 16, 2023 · 5 comments
Open

add control blocked while unassociated layer tiles are loading #1205

nreese opened this issue Nov 16, 2023 · 5 comments
Labels
api API & programatically working with library bug

Comments

@nreese
Copy link

nreese commented Nov 16, 2023

setup.js blocks adding a control until map.loaded() returns true.

      if (map.loaded()) {
        setup.connect();
      } else {
        map.on('load', setup.connect);
        mapLoadedInterval = setInterval(() => { if (map.loaded()) setup.connect(); }, 16);
      }

This is similar to issue #502. The difference between this issue and 502 is that 502 was concerned with load event only getting fired on initial map load. 502 has been resolved with setInterval check that polls to see of map.loaded() returns true. The fix for 502 allows controls to be added once all layer tiles are loaded but still blocks adding controls while layer tiles are loading. Why can't a control be added while layer tiles are loading?

Would it be possible to disable map.loaded() check with an option? So maybe something like

      if (ctx.options.onAddSkipMapLoadedCheck || map.loaded()) {
        setup.connect();
      } else {
        map.on('load', setup.connect);
        mapLoadedInterval = setInterval(() => { if (map.loaded()) setup.connect(); }, 16);
      }
@nreese
Copy link
Author

nreese commented Jan 4, 2024

@underoot Who is the best person to contact to start a conversation about this issue? Should I open a PR? I don't see a lot of feedback on open PRs and don't want to open one unless there is some buy-in for the problem and solution.

@stepankuzmin stepankuzmin added bug api API & programatically working with library labels Jan 8, 2024
@underoot
Copy link
Member

underoot commented Jan 8, 2024

Thank you for your contribution. We will take a look on that issue when we will have time. Meanwhile, PR is welcome also, we will bring feedback as soon as it will be possible from our side

By the way, could you also elaborate a little bit your case. Why you need controls immediately before tiles are loaded. Thank you!

@nreese
Copy link
Author

nreese commented Jan 8, 2024

By the way, could you also elaborate a little bit your case. Why you need controls immediately before tiles are loaded. Thank you!

Our use case is a user created map where users can add layers from many different sources. Some of these sources generate tiles in real time based on current query criteria of the application, for example from Elasticsearch mvt endpoint. Loading tiles may take longer than 30 seconds for extremely large data sets (billions of records). In this example, all records are not returned in the tile, instead, records are grouped into hexagon or grid buckets and aggregated metrics are returned per bucket (like count of records, or average of some numerical value).

Draw controls are provided to allow users to draw geometries on-screen to narrow results. Users would like to be able to use draw controls while tiles are loading.

elastic/kibana#166496 further defines the problem.

@gabrielasil
Copy link

Is there any update on this issue? @nreese did you find a workaround?

@nreese
Copy link
Author

nreese commented Oct 1, 2024

Is there any update on this issue? @nreese did you find a workaround?

There is nothing more from my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API & programatically working with library bug
Projects
None yet
Development

No branches or pull requests

4 participants