Opened 5 years ago

Closed 3 years ago

#2984 closed bug (fixed)

Popup appears automatically when using Google Maps API v3

Reported by: vladimirc Owned by: euzuro
Priority: major Milestone: 2.11 Release
Component: Layer.Google.v3 Version: 2.10
Keywords: google api v3, popup Cc: janise, fish, kjelderg, carcher
State: Needs More Work

Description

When a Google Maps API V3 map is loaded a popup appears containing data and imagery credits and a close button.

The popup can be closed but it keeps appearing again every time you click, pan or zoom the map.

Attachments (3)

googleapiv3popup.jpg (82.6 KB) - added by vladimirc 5 years ago.
Screenshot Google API v3 Popup
openlayers-2984.patch (3.1 KB) - added by ahocevar 4 years ago.
updating form v3.2 to v3.3
googleapiv3popup-2.jpg (28.5 KB) - added by anrikun 3 years ago.

Download all attachments as: .zip

Change History (19)

Changed 5 years ago by vladimirc

Screenshot Google API v3 Popup

comment:1 Changed 5 years ago by erilem

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 4 years ago by ahocevar

  • Component changed from Popup to Layer.Google.v3
  • Resolution fixed deleted
  • State set to Review
  • Status changed from closed to reopened

I did some investigation on this, and apparently r10974 is a workaround, not a fix. Fact is that this popup is not something that Google displays. It is that our logic for moving attribution and logo to the container does not work any more, because the popup was added as hidden element as last child of the google map div, and we made it visible by messing with style.display.

The attached patch moves this hidden element (if available, i.e. if using a new v3 api that has it) to the container without modifying it. The copyright is also no longer switched between hidden and visible, because we move it to an invisible position (-9999px) anyway.

Another positive side effect of this patch is that the PoweredBy logo is clickable again - this was also broken because of this new hidden popup.

Because Google now also sets the position of the copyright and logo using element styles, we need to use !important in our css. So this patch also fixes the css, and modifies google.css to use the correct original positions for v3.

Tests still pass. Thanks for any review.

comment:3 Changed 4 years ago by ahocevar

Please disregard the comment about no longer switching the copyright between hidden and visible - I decided to continue doing so. Better safe than sorry, and eliminates the chance of a regression.

Changed 4 years ago by ahocevar

updating form v3.2 to v3.3

comment:4 Changed 4 years ago by bartvde

  • State changed from Review to Commit

Your patch looks good to me Andreas, please commit. Google V3 Layer tests also pass on IE8 and Firefox 3.6.

comment:5 Changed 4 years ago by ahocevar

  • Resolution set to fixed
  • State changed from Commit to Complete
  • Status changed from reopened to closed

Thanks @bartvde for the review. In w/ r11042.

comment:6 Changed 3 years ago by anrikun

  • Resolution fixed deleted
  • State changed from Complete to Needs More Work
  • Status changed from closed to reopened

Since today, the popup has started to show up again. And copyright is displayed twice.

Changed 3 years ago by anrikun

comment:7 Changed 3 years ago by anrikun

Adding this to CSS hides popup and 2nd copyright:

div.olLayerGoogleCopyright,
div.olLayerGooglePoweredBy
{
  display: none !important;
}

but Google links are still not clickable.

comment:8 Changed 3 years ago by bociek

I confirm that. As for now i've just switched to v3.6, thats "solves" that issue.

Doesn't anrikun's CSS solution break Terms Of Use?

comment:9 Changed 3 years ago by anrikun

My solution is just a temporary hack that prevents popup from showing up, but not a viable solution as Google links are not clickable. Google copyright and notices are still displayed though, but the fact that they are not clickable might indeed break TOS, I don't know.

comment:10 Changed 3 years ago by ahocevar

  • Resolution set to fixed
  • Status changed from reopened to closed

Fixed with https://github.com/openlayers/openlayers/commit/b17c7b69f25ce0ddbaf720f91b7d48328b005831 - add documentation on the supported API version, so people don't use versions > 3.6.

comment:11 Changed 3 years ago by bociek

  • Resolution fixed deleted
  • Status changed from closed to reopened

As for now, google forces use of 3.7, even when requested 3.6, so problem reappears.

comment:12 Changed 3 years ago by janise

  • Cc janise added

comment:13 Changed 3 years ago by fish

  • Cc fish added

comment:14 Changed 3 years ago by kjelderg

  • Cc kjelderg added

comment:15 Changed 3 years ago by carcher

  • Cc carcher added

comment:16 Changed 3 years ago by ahocevar

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.