There is a bug in the Popup component Javascript currently. Popups do not display unless you click the map feature more than once.
I traced this to the following chunk of code in popup.js:
// If this is a click to the same feature marker it's a close command.
if (jQuery(container).data('feature-key') == feature[UID_PROPERTY_]) {
container.style.display = 'none';
jQuery(container).data('feature-key', '');
return;
}
If I comment out that chunk, popups work perfectly.
I'm not exactly sure that the purpose of that code is - but it seems to have something to do with handling the "close popup" event when the X is clicked. But if you look a little farther up in the same file, there is already code for handling that, so closing works fine without the above chunk. Here is the code that handles closing the popup:
/**
* Add a click handler to hide the popup.
* @return {boolean} Don't follow the href.
*/
closer.onclick = function() {
container.style.display = 'none';
closer.blur();
return false;
};
Original issue description (from the Farm Map issue queue):
I'm not sure what's causing this, but you can't open the area details popup with a single click.
Comment | File | Size | Author |
---|---|---|---|
#3 | openlayers_popup_click-2606054-3.patch | 729 bytes | m.stenta |
Comments
Comment #2
m.stentaI isolated the code that is causing this issue in the Openlayers Popup component. Moving this issue to that project and updating the title and description. Patch coming soon...
Comment #3
m.stentaHere is a simple patch that removes the chunk of code causing the issue. I don't think it's necessary.
Comment #4
m.stentaComment #5
PolThanks !