Ticket #2984 (closed bug: fixed)

Opened 17 months ago

Last modified 6 days ago

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

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

Change History

Changed 17 months ago by vladimirc

Screenshot Google API v3 Popup

Changed 17 months ago by erilem

  • status changed from new to closed
  • resolution set to fixed

Changed 17 months ago by ahocevar

  • status changed from closed to reopened
  • resolution fixed deleted
  • state set to Review
  • component changed from Popup to Layer.Google.v3

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.

Changed 17 months 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 16 months ago by ahocevar

updating form v3.2 to v3.3

Changed 16 months 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.

Changed 16 months ago by ahocevar

  • status changed from reopened to closed
  • state changed from Commit to Complete
  • resolution set to fixed

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

Changed 4 months ago by anrikun

  • status changed from closed to reopened
  • state changed from Complete to Needs More Work
  • resolution fixed deleted

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

Changed 4 months ago by anrikun

Changed 4 months 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.

Changed 3 months 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?

Changed 3 months 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.

Changed 3 months ago by ahocevar

  • status changed from reopened to closed
  • resolution set to fixed

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

Changed 7 days ago by bociek

  • status changed from closed to reopened
  • resolution fixed deleted

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

Changed 7 days ago by janise

  • cc janise added

Changed 7 days ago by fish

  • cc fish added

Changed 7 days ago by kjelderg

  • cc kjelderg added

Changed 7 days ago by carcher

  • cc carcher added

Changed 6 days ago by ahocevar

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