Page MenuHomePhabricator

Mapframe does not display properly when placed inside a collapsible environment
Closed, ResolvedPublic

Description

Mapframe does not work properly when placed inside a collapsible environment. Only part of the map is shown on the left side. See example here:

https://ru.wikivoyage.org/wiki/User:Atsirlin/maps-div

Event Timeline

Atsirlin created this task.Jun 14 2016, 4:18 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 14 2016, 4:18 PM
Atsirlin triaged this task as Normal priority.Jun 14 2016, 4:19 PM
Yurik added a subscriber: JGirault.
Restricted Application added a project: Discovery. · View Herald TranscriptJun 14 2016, 4:20 PM

At first sight the situation seems to be a bit challenging: the map would require a map.invalidateSize() on expand, but it seems nothing in the code can notify us about the change in container's collapsed/expanded status...

As a consequence, I'm not sure where to put a hook and ask leaflet to redraw the map, but I'll keep poking my head around it.

Yurik moved this task from Backlog to To-do on the Maps-Sprint board.Jun 15 2016, 2:07 AM
Yurik raised the priority of this task from Normal to High.Jun 16 2016, 4:14 PM

Change 294839 had a related patch set uploaded (by JGirault):
Fix mapframe not displaying properly when placed inside a collapsible container.

https://gerrit.wikimedia.org/r/294839

We could go a bit further and avoid creating maps that are hidden by default. Only instantiate the Leaflet map when the collapsed container expands. This would save some JS execution time on page load. I will create a ticket in the backlog.

Change 294839 merged by jenkins-bot:
Fix mapframe not displaying properly when placed inside a collapsible container.

https://gerrit.wikimedia.org/r/294839

Change 294856 had a related patch set uploaded (by Yurik):
Fix mapframe not displaying properly when placed inside a collapsible container.

https://gerrit.wikimedia.org/r/294856

Change 294856 merged by jenkins-bot:
Fix mapframe not displaying properly when placed inside a collapsible container.

https://gerrit.wikimedia.org/r/294856

Yurik closed this task as Resolved.Jun 16 2016, 11:07 PM
Yurik claimed this task.
Atsirlin reopened this task as Open.Aug 12 2016, 1:01 AM

I re-open this task, because there are problems with maps in the collapsible environment again. Check, for example:

https://ru.wikivoyage.org/wiki/Гродненская_область

and click on "Открыть карту". Only a small part in the top of the map is displayed.

Yurik added a comment.Aug 12 2016, 1:04 AM

Thanks @Atsirlin, must be some bug with our latest version. @JGirault could you take a look?

It is highly desirable to solve this problem ASAP, because it affects all pages on Russian Wikivoyage

Change 305063 had a related patch set uploaded (by JGirault):
Fix mapframe not displaying properly when placed inside a collapsible container.

https://gerrit.wikimedia.org/r/305063

Change 305063 merged by jenkins-bot:
Fix mapframe not displaying properly when placed inside a collapsible container.

https://gerrit.wikimedia.org/r/305063

MaxSem closed this task as Resolved.Aug 16 2016, 9:25 PM
MaxSem reassigned this task from Yurik to JGirault.