I amtrying to solve a google map problem for someone, the page has a expand tab, when clicking the expand tab it shows the full map, what's happening in the backend is changing the map div margin-right to 0, the problem is there is an area on the far right is not showing the map. I tried google.maps.event.trigger(this.map, 'resize');and it's not fixing the issue.
var resultsCont = $('#resultsCont');
var mapCont = $('#mapCont');
if (resultsCont.is(':visible')){
resultsCont.hide();
mapCont.css('margin-right',0);
}else{
resultsCont.show();
mapCont.css('margin-right',320);
}
google.maps.event.trigger(this.map, 'resize');
I can't see the rest of your code, but I'm guessing that this.map is a copypasta relic. The first argument in the trigger is the maps object.
So whatever is on the left of:
var thisguy = new google.maps.Map(yada, yada)
google.maps.event.trigger(thisguy, 'resize');
Assuming it's in scope.
Could be wrong, just guessing at this point. Jebus, just checked the date ... looks like I got here a little late.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With