AmericanRedCross / disaster-asset-manager

node app to make building the mapfolio a lot easier
0 stars 1 forks source link

map for adding location doesn't always load #24

Closed danbjoseph closed 9 years ago

danbjoseph commented 9 years ago

sometimes the map doesn't load in the asset modal. will document the problem better and update this issue when I have some details to provide.

kevinlustig commented 9 years ago

The map has to be initialized after it is fully visible in the modal, or else Leaflet doesn't know how to handle its tiles properly. This should be controlled by the Bootstrap modal's "shown" event, but it seems like occasionally the timing doesn't work out. I've put a check into the geo stuff init function to check if the map container is visible. If not, it waits a small timeout (100 ms) and then tries to initialize again. This is ready to test, and will hopefully resolve the issue.