-
Notifications
You must be signed in to change notification settings - Fork 1.1k
map render problem in different tabs #1395
Comments
The behavior is caused by the maps in unselected tabs being rendered into hidden elements. The correct approach is to prevent map creation until the elements that will show it aren't hidden. You can use However, this is really strange because the FAQ's recommendation to use Not sure what the problem is. Hopefully I'm missing something obvious. @cthrax thoughts? |
The ng-if condition is changing in the same digest loop as the display of the tabs, so the DOM still hasn't had a chance to render. If you disconnect those conditions, which honestly feels a little weird semantically, it will render properly. See this plnkr for an example http://plnkr.co/edit/KatCddVOfefPw9c09yPM?p=preview |
Nice 👍 I've learned another nuance of Angular's digestion... @uguryilmaz Follow up and reopen if this doesn't resolve the issue for you. Thanks. |
thanks so much @cthrax and @wrummler . that solves my problem. |
🎱 |
Sometimes just setting ng-if to true doesn't solve the problem. I use following code to refresh map.
|
i have a tab control in my form. every tab page has its map object. first tab loads succesfully but maps in other tabs not loaded successfuly. here is plunker:
http://plnkr.co/edit/JUHRt5ogLcq0Eq6uo8n1?p=preview
The text was updated successfully, but these errors were encountered: