Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #472 from probins/goopop

Fix Google terms/poweredby/popup. Thanks @probins for the quick fix.
  • Loading branch information...
commit 92f04a7a4277a6c818ef2d40a2856910ed72d3d6 2 parents 2624ea0 + f435a98
@ahocevar ahocevar authored
Showing with 24 additions and 20 deletions.
  1. +24 −20 lib/OpenLayers/Layer/Google/v3.js
View
44 lib/OpenLayers/Layer/Google/v3.js
@@ -137,27 +137,31 @@ OpenLayers.Layer.Google.v3 = {
var cache = OpenLayers.Layer.Google.cache[this.map.id];
var container = this.map.viewPortDiv;
- // move the Map Data popup to the container, if any
- while (div.lastChild.style.display == "none") {
- container.appendChild(div.lastChild);
- }
-
// move the ToS and branding stuff up to the container div
- var termsOfUse = div.lastChild;
- container.appendChild(termsOfUse);
- termsOfUse.style.zIndex = "1100";
- termsOfUse.style.bottom = "";
- termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3";
- termsOfUse.style.display = "";
- cache.termsOfUse = termsOfUse;
-
- var poweredBy = div.lastChild;
- container.appendChild(poweredBy);
- poweredBy.style.zIndex = "1100";
- poweredBy.style.bottom = "";
- poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";
- poweredBy.style.display = "";
- cache.poweredBy = poweredBy;
+ // depends on value of zIndex, which is not robust
+ for (var i=div.children.length-1; i>=0; --i) {
+ if (div.children[i].style.zIndex == 1000001) {
+ var termsOfUse = div.children[i];
+ container.appendChild(termsOfUse);
+ termsOfUse.style.zIndex = "1100";
+ termsOfUse.style.bottom = "";
+ termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3";
+ termsOfUse.style.display = "";
+ cache.termsOfUse = termsOfUse;
+ }
+ if (div.children[i].style.zIndex == 1000000) {
+ var poweredBy = div.children[i];
+ container.appendChild(poweredBy);
+ poweredBy.style.zIndex = "1100";
+ poweredBy.style.bottom = "";
+ poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";
+ poweredBy.style.display = "";
+ cache.poweredBy = poweredBy;
+ }
+ if (div.children[i].style.zIndex == 10000002) {
+ container.appendChild(div.children[i]);
+ }
+ }
this.setGMapVisibility(this.visibility);
Please sign in to comment.
Something went wrong with that request. Please try again.