Just in case, if you'll use a map over a modal it doesn't show correctly by default, indeed displays a "Grey" area's when it is placed inside a dynamic element. So do you need the next work around:
var currentCenter = GoogleMaps.maps.yourMap.instance.getCenter(); google.maps.event.trigger(GoogleMaps.maps.yourMap.instance, "resize"); GoogleMaps.maps.loadCenterMap.instance.setCenter(currentCenter); // Re-set previous center
The first and the third lines are just for reset the center because the resizing affects the center.
I lost a lot of time thinking that the problem was in api or something like that.
Hi everyone,
Just in case, if you'll use a map over a modal it doesn't show correctly by default, indeed displays a "Grey" area's when it is placed inside a dynamic element. So do you need the next work around:
var currentCenter = GoogleMaps.maps.yourMap.instance.getCenter(); google.maps.event.trigger(GoogleMaps.maps.yourMap.instance, "resize"); GoogleMaps.maps.loadCenterMap.instance.setCenter(currentCenter); // Re-set previous center
The first and the third lines are just for reset the center because the resizing affects the center.
I lost a lot of time thinking that the problem was in api or something like that.