After zooming in, popups cease to be triggered by clicking on features.

CommentFileSizeAuthor
#3 openlayers-532194.patch1.08 KBbrynbellomy

Comments

brynbellomy’s picture

Actually after some poking around, I found that it's very difficult to reproduce this problem in a consistent way. Sometimes popups do come up, sometimes they don't. If I zoom out a few times and mess with other things on the map (other popups, etc.), the missing popup might start to appear again. Sometimes zooming in doesn't stop the popup from coming up in the first place.

Just a thought, but may be related to:

OL.Behaviors.popupClosed = function(event) {
  // @@TODO: Currently the feature is not unselect when the popup is closed. This function should do that.
}

in openlayers_behaviors.behaviors.js

brynbellomy’s picture

Status: Active » Closed (fixed)

Actually, after more poking around, I think it has nothing to do with zooms. Sorry for the white noise. I think it has to do entirely with the fact that features don't un-select when you click the red X. I wasn't testing very cleanly.

brynbellomy’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.08 KB

Here's a patch that automatically unselects a feature when its popup is closed. I gave the OpenLayers.Popup.FramedCloud constructor a callback for when popups close. The callback calls SelectControl's unselect() function.

phayes’s picture

Status: Needs review » Fixed

Committed: http://drupal.org/cvs?commit=243916

Changes to the patch: instead of using instanceOf, which doesn't guarantee we will find the correct control. For example, there could be a selectFeature control for a different layer that the loop might find first. Instead I added an extra attribute to the layers drupalData, and used that to find the correct control.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

d.sibaud’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Component: OpenLayers Behaviors » OL API
Status: Closed (fixed) » Patch (to be ported)

This is the same wrong behavior I meet in the 7.x-2.x release, and when I applied this 6.x patch on includes/behaviors/js/openlayers_behavior_popup.js all went to its place. Please port the patch to the 7.x version and commit it. Thanks a lot for this patch.

d.sibaud’s picture

Component: OL API » OL Behaviors

Pardon, I forgot to set the right component

pol’s picture

Assigned: Unassigned » pol
Status: Patch (to be ported) » Needs work
pol’s picture

To people having problems with popup, could you try this: http://drupal.org/sandbox/Pol/1877914

It's a module adding a new behavior to OL with a new popup handling using an external library.

I'll need feedback on this.