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

Add resize trigger #166

Closed
koodikindral opened this issue Feb 25, 2016 · 2 comments
Closed

Add resize trigger #166

koodikindral opened this issue Feb 25, 2016 · 2 comments

Comments

@koodikindral
Copy link

There's no way to rezize the map, for example if I load map into hidden tab. In that case map will be not shown at all, it needs to be resized.

@sebholstein
Copy link
Owner

@koodikindral you mean this kind of calls, right?:

google.maps.event.trigger(map, 'resize');

@tuqtran
Copy link

tuqtran commented Feb 26, 2016

I have that problem too. However, it can be work around by dispatch 'resize' event after hidden element is visible.
setTimeout(function(){
window.dispatchEvent(new Event("resize"));
}, 1);

sebholstein added a commit that referenced this issue Mar 5, 2016
SebmGoogleMap now supports triggering resize events
on the google map instance. This is usefull when you intially
hide the map (for example in a tab) and then want to show
the map:

```
<div [hidden]="!showMap">
	<sebm-google-map #myMap></sebm-google-map>
</div>
<button (click)="showMap = true; myMap.triggerResize()">resize</button>
```

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

No branches or pull requests

3 participants