EOX-A / EOxElements

A Web Component collection of geospatial UI elements, crafted by EOX.
https://eox-a.github.io/EOxElements/
MIT License
12 stars 2 forks source link

Control for viewing the loading state #911

Open StefanBrand opened 2 months ago

StefanBrand commented 2 months ago

Related to #443 and having in mind the question whether all events should be bubbled up: https://github.com/EOX-A/EOxElements/issues/443#issuecomment-1820862029

We would like to show the user when the map is loading. I was thinking, it could be a control that shows a loading spinner between loadstart and loadend events.

Alternatively, or in addition, a loading property could be exposed that allows handling the loading state outside of the eox-map.

RobertOrthofer commented 2 months ago

Do you want to create a loading indicator like this: https://openlayers.org/en/latest/examples/load-events.html ? The easiest way of doing this is by emitting the loadstart-event, just like we are already emitting the loadend-Event. Would this be sufficient? I suppose we can also create a loading-Event, with a boolean value of the loading state.

StefanBrand commented 2 months ago

I had a built-in control/functionality in mind, which can be toggled on by configuration. Yes, like the example, but the boilerplate lives inside eox-map.

RobertOrthofer commented 2 months ago

Ah, I should read from the start. Yes, a control might be the most intuitive. Can you provide a graphic that we can use as a default spinner?

StefanBrand commented 2 months ago

Nope, I don't, but I just found this neat website that lets you create spinners under a public domain license : https://loading.io/