The first time I click on a point, the popup appears as it should, but nothing happens if you want click on it later again.
When I use a two different markers as "Style" and "Select Style" then the marker does not revert back to the normal style after closing the popup.

Comments

gerontas’s picture

I can confirm this. After a point has been selected, it shows the correct 'select' style which remains after the pop-up is closed and the pop-up no longer works for that point. That condition remains until the map is reloaded.

I can't see anything that can be changed in the UI for this.

pol’s picture

Status: Active » Fixed
gerontas’s picture

That's looking good! Thanks Pol - much appreciated!

paularmand’s picture

I can confirm the patch works. It however also disables any behaviours attached to the contents of the popup (in my case ajax-links). I believe the "Drupal.attachBehaviors();" line was probably removed by accident. I can also confirm that by reenabling this line in the patched code, the behaviours are correct attached to the popup contents. Do we have to patch this, or can you edit the patch itself?

artbussy’s picture

Thanks Pol & Paularmand, this works on my install. Have included but not tested Paularmand's remark. It doesn't throw any errors. As a non-coder implementing this is quiet a hassle. I guess a patch would be much appreciated by many dummies like me.

pol’s picture

Assigned: Unassigned » pol
Status: Fixed » Needs work
camhoward’s picture

Thanks for this! I ran into the same issue ifrik described. I applied Pol's patch in note #2 and paularmand's revision in note #4 and users can now select a popup as often as they wish. Thank you!

juliusvaart’s picture

I can confirm patch in #2 works.

spiderman’s picture

StatusFileSize
new1.84 KB

I've just re-rolled this commit as a patch with the attachBehaviours() line still in, so those of us pulling modules in with drush make can use this:

projects[openlayers][version] = 2.0-beta3
projects[openlayers][patch][1876702] = http://drupal.org/files/openlayers_behaviour_popup.1876702_1.patch
pol’s picture

Committed ;-)

Thanks for the help, Javascript is really not my cup of tea :-)

pol’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

berliner’s picture

Status: Closed (fixed) » Active

Hi, the patches from #2 and #9 seem to be broken and the changes are not included in the beta3 release as far as I can see.

Georgique’s picture

Status: Active » Closed (fixed)

@berliner Changes will be included in the next beta.
And patches are ok. You can even apply them manually.

berliner’s picture

Serious? I got errors trying to patch the beta3 with the patches proposed here. I had to apply them manually, meaning by transferring the changed parts by hand ...
But, ok, as long as it's in the next release. I just had the impression that the fix had been lost. Sorry for the trouble.

gillesbailleux’s picture

@berliner: just tested patch #9 and it works with OpenLayers 7.x-2.0-beta3 and Drupal 7.21

berliner’s picture

ok, good to know :-) So it's been a problem on my side.

jcl324’s picture

Has this been rolled into the dev branch yet?

pol’s picture

#killmeplease

magtak’s picture

like @ #9. I've been stuck at this for hours...

brahimmouhamou’s picture

I also had this problem, the patch works but I have a page with an openlayers map and an embeded vimeo video. Each time I open a pop up, the vimeo video flashes (becomes invisible for a millisecond). Very annoying.

xeeshangulzar’s picture

Thank you so much Pol. You resolved my issue.

charlied’s picture

For those who find patches scary, 7.x-2.0-beta7 fixed #1 for me - thanks !

nirad’s picture

Status: Closed (fixed) » Needs work

I tried both #2 and #9, and neither works with javascript inside of the popup, despite the latter having the line Drupal.attachBehaviors();. My particular use case is a toggle for the Flag module inside of the popup. If I click on the javascript flag link, the page refreshes.

I had downgraded from beta7 to beta3 because of this problem. In beta 3, the javascript inside the popup works, but then the popup only works once and then disappears. After this patch, the javascript doesn't work. I believe these issues were not present in beta 1 and/or beta 2.

nirad’s picture

I opened a new issue to deal with the issue of ajax events not propagating in the popup since that is different issue than the popup only working once: https://drupal.org/node/2054215

spiderman’s picture

Status: Needs work » Closed (fixed)