1

I have a kml layer, and have a popup open when the user selects on a feature.

I use OpenLayers.Control.SelectFeature and OpenLayers.Popup.FramedCloud. The selection happens when the user clicks.

If the popup is open, I cannot click, pan or zoom the map whilst within the popup div. This is particularly noticeable with the FramedCloud popup, because a large chunk of the div is transparent.

I guess the events are no longer happening as far as the map is concerned, because the div is in the way. I am not saying it is wrong, it is just confusing when it looks like you click on the map and nothing is happening.

Also, regardless of whether or not the popup is open, drag no longer works if you are over a feature (guess the event is doing something else now).

I think I would like the events to continue to happen on the map. Is that possible?

Thanks

1
  • I am taking a different approach at the moment. Thanks for your answers.
    – zod
    Commented Jan 2, 2013 at 15:10

2 Answers 2

2

The SelectFeature control is preventing the click to propagate to other controls. You should deactivate after use to avoid those interferences.

Or you going need to overload parts of it to change the behavior to do what you want.

I not sure but I guess you going need to change the handlers of control to permit clicks to propagate.

2

Try use:

var framedCloudCustomized = OpenLayers.Class(OpenLayers.Popup.FramedCloud, {
  displayClass: "olScrollable olPopup",
  registerEvents:function() {
    this.events = new OpenLayers.Events(this);
  }
});
myPopup = new framedCloudCustomized(...);

NOTES:

  1. In this manner you can not select text popup.
  2. You can also zoom using the mouse wheel, but only with the development version of "lib/OpenLayers/Handler/MouseWheel.js"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.