Hi there,

I have a wonderful Openlayers map with some custom markers that works really well. I have the 'Pop Up for Features' behavior enabled and it displays the title and description of my mapped companies.

Everything works really well, except for the fact that the pop-ups are, by default, extreeeemely wide, and do not stay within the current map window. Every time I click on a pin, the window moves way off from the center of the cluster of pins. The user then has to move the map back to center it, clicks on another pin to get information and again -- whoosh -- the screen moves way off to accommodate the long pop-up with the pins again ending up on the very side of the screen, while most are out of view.

Does that make sense? The pop-ups are extremely wide and move the map around a ton. Because they take up pretty much the entire screen width-wise and pan the map around to accommodate their width, the screen pretty much moves 100% of the time, unless you click on the exact same pin twice.

I'm including a patch to the openlayers_behavior_popup.js file, in which I set the popup's keepInMap and panMapIfOutOfView properties.

With the patch, all works wonderfully and the pop-up boxes look so much better because they're not just one really long line of text.

Would you all considering applying this patch for the next version of openlayers?

I'm attaching a couple of screenshots to show before and afters!

Thanks,
Boriana

Files: 
CommentFileSizeAuthor
#6 openlayers-popup_keep_in_map-1808964.patch2.07 KBditcheva
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch openlayers-popup_keep_in_map-1808964_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 openlayers-popup_keep_in_map-1808964.patch2.08 KBditcheva
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch openlayers-popup_keep_in_map-1808964.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
post-patch.jpg159.52 KBditcheva
pre-patch.jpg199.65 KBditcheva
openlayers-popup_keep_in_map.patch661 bytesditcheva
PASSED: [[SimpleTest]]: [MySQL] 236 pass(es).
[ View ]

Comments

Category:support» bug
Status:Active» Needs review

This works really well for me, as I was having the same issue and was trying to control the behavior with css (unsuccessfully).

I think this should be considered a bug, which now has a patch for review.

Just wondering again whether this could be considered as part of the next release... :-)

Status:Needs review» Needs work

Hello,

I'm ok to include the patch if you provide a way to customize these options in Drupal.

Have a look at the file: plugins/behaviors/openlayers_behavior_popup.inc and add those two settings in the configuration form.
Once we'll be able to change those values through Drupal, I'll include your very useful patch.

Thanks !

Status:Needs work» Needs review
StatusFileSize
new2.08 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch openlayers-popup_keep_in_map-1808964.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Thanks for the suggestion, Pol. I should have thought of that from the very beginning!

Here is an updated patch with those options exposed in the user interface. I've tested and they work well. :-)

Boriana

Status:Needs review» Needs work

The last submitted patch, openlayers-popup_keep_in_map-1808964.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new2.07 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch openlayers-popup_keep_in_map-1808964_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Oops. Looks like I made the patch against 7.x-2.x and not the version the issue is attached to. Here goes again.

Can't think what else may be wrong with it...

Status:Needs review» Needs work

The last submitted patch, openlayers-popup_keep_in_map-1808964.patch, failed testing.

Version:7.x-2.0-beta1» 7.x-2.x-dev

Status:Needs work» Needs review

Status:Needs review» Fixed

Thanks, committed, please, give us feedback !

Works fine for me.

The pop-up appears only the first time. After closing it, the pop-up it's not working. Not sure if this is the default behavior ... just wondering.

It's fixed in the dev version.

Status:Fixed» Closed (fixed)

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