Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map not displayed correctly #14

Open
Bartzi opened this issue Jul 9, 2015 · 2 comments
Open

Map not displayed correctly #14

Bartzi opened this issue Jul 9, 2015 · 2 comments

Comments

@Bartzi
Copy link
Contributor

Bartzi commented Jul 9, 2015

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

image

Investigate and fix!

@Bartzi Bartzi added the bug label Jul 9, 2015
@sknebel
Copy link
Member

sknebel commented Jul 11, 2015

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 tombatossals/angular-leaflet-directive#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.

@Bartzi Bartzi added this to the share Map Positions milestone Aug 6, 2015
@sknebel
Copy link
Member

sknebel commented Oct 31, 2015

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

unbenannt_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants