iag-geo / bootleaf

An open-source version of IAG's Bootleaf fork
https://demo.bootleaf.xyz
MIT License
89 stars 65 forks source link

Error message when geoJson layers are not at the top of layers list #5

Closed SchroeC closed 5 years ago

SchroeC commented 5 years ago

Hello,

I'd like to thank IAG for providing boot-leaf open source and Stephan Lead for the work he’s done putting the framework and documentation together. I'm a novice web developer experimenting with your source code though django web framework.

I've found what seems to be an issue in the way boot-leaf manages layers. If I move the example geojson layers to a different position in the layers list I get the following error when the map loads. This error seems to appear if any of the geojson are not at the top of the list. The functionality of the Map appears to be unaffected (all layers load, just the error message appears).

untitled

Aside from from the config file, below is list of modifications I've made to the bootleaf source:

Installation

Package was split into the following to match Django filing structure:

Customizations

Fixes

slead commented 5 years ago

I can reproduce the error when the JSON layers aren't found at the top of the list - I'll look into it as soon as possible.

For now, the workaround is - put them at the top of the list ;)

It's cool to see that you're using this in Django, I'd love to see the finished app when you're done

slead commented 5 years ago

This should now be fixed in the latest version. The change is around line 357 of app.js:

// Add the layer to the map if it's not hidden. geoJSON layers are added after their Ajax call has completed
if (!layerConfig.hidden && layerConfig.type !== 'geoJSON') {
  addLayer(layer);
}

Let me know if you see any further issues.

SchroeC commented 5 years ago

Hey! wow fast turn around. Yes I'll post any issues I find and I'll share what I end up with in the end.

Thanks!