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

Ensure openlayers mapinfo state is immediately updated as soon as component mounted #1348

Merged

Conversation

manisandro
Copy link
Contributor

If there is a zoomToExtent call in the app setup logic, and one opens the app in a background tab, it can happen that zoomToExtent throws an exception in MapUtils.js@defaultGetZoomForExtent due to mapSize being null. mapSize is set in openlayers/Map.jsx@map.on('moveend'), but the first call to this event handler may happen too late because browsers often pause/slow down js execution in background tabs.

This PR ensures that the map info state is immediately updated as soon as the map component is mounted, as is done in leaflet/Map.jsx.

@simboss simboss added the ready label Dec 13, 2016
Copy link
Contributor

@mbarto mbarto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix lint errors

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 80.242% when pulling fda2105 on sourcepole:openlayers_mapstate_update into e937622 on geosolutions-it:master.

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

Successfully merging this pull request may close these issues.

None yet

4 participants