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

Loading indicator stays on for GeoJSON data #43

Open
floggle opened this issue Apr 6, 2019 · 1 comment
Open

Loading indicator stays on for GeoJSON data #43

floggle opened this issue Apr 6, 2019 · 1 comment

Comments

@floggle
Copy link

floggle commented Apr 6, 2019

Neat plugin. Seems to be more complex to do this than you'd expect.

I have a basemap that's geojson data with many objects. There's also another (non-geojson) baselayer. The loading indicator is fine if the base-layer starts as the geojson, but when switching back to the geojson baselayer, the loading indicator appears and never disappears.

The problem seems to be that inside _handleBaseLayerChange the plugin runs addLoader for each child layer (as GeoJSON loads as a group). But they are then never triggered. Don't know why.

I worked around this by simply disabling it for LayerGroups:

                    if(!e.layer instanceof L.LayerGroup) {
                        e.layer.eachLayer(function (layer) {
                            that._handleBaseLayerChange({layer: layer});
                        });
                    }

but it's a weak solution

@ebrelsford
Copy link
Owner

If you wouldn't mind sharing a minimal example that shows this issue that would be helpful. I'm also open to pull requests that fix it.

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

No branches or pull requests

2 participants