meet-here / frontend

https://github.com/meet-here/frontend
1 stars 0 forks source link

Map not displayed correctly #14

Open Bartzi opened 9 years ago

Bartzi commented 9 years ago

when changing from one menu entry to another and back to the map display, the map is not displayed correctly:

image

Investigate and fix!

sknebel commented 9 years ago

Leaflet has to be notified when it's size changes to recalculate stuff. Apparently it gets create in one size and then resized to full size, possibly by angular material?

Compare http://leafletjs.com/reference.html#map-invalidatesize and see https://github.com/tombatossals/angular-leaflet-directive/issues/818

The first answer suggests calling

leafletData.getMap().then(function(map) {
    map.invalidateSize();
  });

after the resize happens (I'm not sure how we can get that event, I certainly don't want it called in a timer...), the author of the leaflet-directive suggests not recreating the directive, which also seems sensible -> a user nearly always will return to the map view and there is no point in recreating the map, reloading the tiles, applying all changes again, ...

TL;DR: we probably shouldn't recreate the map-view, but just hide it when we are in other screens.

sknebel commented 8 years ago

This seems now the default, also the "action button" is now positioned in the middle (Firefox 41.0.2 / Win7)

unbenannt_