Open SebBareyre opened 10 years ago
@SebBareyre Check that the maps container has a set height and size when it's loaded into the page. This usually happens when the container doesn't have a fixed size or is hidden when the js is loaded.
I have set width and height and it doesn't work either. I think the problem come from the map is located in a hidden tab at page loading... no ?
@SebBareyre yes, this will happen if you try to load the map before it is visible
ok and how we could solve that ?
up
@SebBareyre After showing tab with map you need to trigger following code:
var center = map.getCenter();
google.maps.event.trigger(map, 'resize');
map.setCenter(center);
This will refresh map and everything should be fine then. Middle line is significant here, other two are only to ensure center of the map will stay the same.
Any idea to trigger this code on click tab in sonataadmin?
Hello, I have a bug when i use this bundle in a sonata admin tab. Could you help me to solve this problem.
Thanks Seb