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

Map view: ensure data extent is set on start #147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JakobMiksch
Copy link
Contributor

  • before when the map was loaded the extent was initially at null island and jumped afterwards to the extent of the data. see GIFs below. I find this a bit distracting and confusing.
  • this PR ensures the map has the data extent directly at the start by loading the data first and initializing the map afterwards
  • for loading the data the very ancient XMLHttpRequest was chosen to guarantee maximum browser compatibility. However we could also use the more modern fetch approach.

before:

ol-before

after:

ol_after

@JakobMiksch JakobMiksch changed the title Mapview: ensure data extent is set on start Map view: ensure data extent is set on start Oct 15, 2023
@dr-jts
Copy link
Collaborator

dr-jts commented Oct 17, 2023

What if the data takes a long time to load, or errors out?

@JakobMiksch
Copy link
Contributor Author

JakobMiksch commented Oct 21, 2023

  • loading the in-built example with 10000 points loads in reasonable time (a few seconds):

Peek 2023-10-21 16-02

  • when I add a 5 second timeout in the JavaScript code, the map stays white until there is data to display, see here:

timeout

  • I have not simulated a complete timeout ( so that there will be no data returned at all), but I guess then the map will stay white forever ...

What would be your preferred behavior in this case?

@JakobMiksch
Copy link
Contributor Author

@dr-jts I pulled the latest commits from master and it still works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants