How to use google.maps.event.trigger(map, 'resize')

前端 未结 5 1604
無奈伤痛
無奈伤痛 2020-11-28 12:49

I am new to JS, and have found the answer to a previous question, which brought up a new question, which brought me here again.

I have a Reveal Modal that contains a

5条回答
  •  感情败类
    2020-11-28 13:27

    As now, google.maps.event.trigger(map, 'resize') does nothing. Like we having mat-dialog containing google map in it and there is the same problem. I`ve found some ways you can handle it:

    1. Init map with a timeout.
    2. Change the size of the parent container after map inits and then change it back.

    But as for me, all these ways are pretty bad and I`m looking for something better.

提交回复
热议问题