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

show spinner centered of the screen #25

Open
hmarina opened this issue Sep 5, 2015 · 3 comments
Open

show spinner centered of the screen #25

hmarina opened this issue Sep 5, 2015 · 3 comments

Comments

@hmarina
Copy link

hmarina commented Sep 5, 2015

I would like to show centered loading spinner position, is there way to show separate and centered of the screen.
thank you.

@ebrelsford
Copy link
Owner

I don't see why not, have you tried changing the CSS to center it?

@nenadvicentic
Copy link

nenadvicentic commented Jul 25, 2019

I just played with this (3 years later). It does not seem to be achievable without hacking into Leaflet.

Leaflet puts each element extending L.Control into one of four containers: topleft, topright, bottomleft and bottomright which is determined by optional position property of a L.Control. This containers are set to position: absolute and stitched to the egdes of leaflet-control-container. Only leaflet-control-container has css position set to "relative" and has same dimensions as full map.

In order to position LoadingControl to the center of a map, it needs to be placed directly into leaflet-control-container and not into child containers. This is currently not possible.

@ebrelsford
Copy link
Owner

Yes, the plugin would likely need to put the loading element somewhere outside of the typical Leaflet control elements if we wanted to do this.

I'm not convinced centering the spinner is a good idea design-wise and generally prefer to stick with the standard Leaflet controls configuration, so I'm not going to work on this. If someone wanted to work on a pull request I might consider merging it.

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

No branches or pull requests

3 participants