1

Topic: Recent issues with google maps

We just noticed that the maps in our forms were not being contained within the map container if we used google maps.

I've determined that this is due to recent changes in the google maps api.

The solution has been to force google maps to use an older version of the api rather than allow it to choose the current 3.27.

In helper_base.php at ~ line 668 I made the following change:

'googlemaps' => array('javascript' => array("http://maps.google.com/maps/api/js?v=3&sensor=false")),

changed to:

'googlemaps' => array('javascript' => array("http://maps.google.com/maps/api/js?v=3.26&sensor=false")),

I'm hoping that this of use to any of you that may be having a similar issue.


Robin

Robin Jones
IT Manager: Species Conservation
Wildfowl & Wetlands Trust

2

Re: Recent issues with google maps

Thanks. This will only be a temporary solution though as 3.26 will cease to be available after the next update cycle in 3 months.
https://developers.google.com/maps/docu … /versions.

Jim Bacon.

3

Re: Recent issues with google maps

Thanks Jim,

I guess I will try and work out which change has caused the issue after all.

Robin

Robin Jones
IT Manager: Species Conservation
Wildfowl & Wetlands Trust

4

Re: Recent issues with google maps

I've investigated the differences between a map page using google maps api 3.26 and 3.27 and have found the offending item.

For 3.26 which displays correctly:

<div class="gm-style" style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0;">


For 3.27 where the map extends beyond the containing div:

<div class="gm-style" style="position: absolute; left: 0px; top: 0px; height: 100%; width: 100%; padding: 0px; border-width: 0px; margin: 0px; z-index: 0;">

The key difference is the "overflow: hidden;"  which must have been applied by the google api.

Running $(".gm-style").css("overflow","hidden") in the console instantly corrects the map, so the long term solution should be to add this as a css entry. Which would be the most appropriate css file to add this to?

        .gm-style {overflow:hidden;}

Thanks,
Robin

Robin Jones
IT Manager: Species Conservation
Wildfowl & Wetlands Trust