We are using the Zoom to Layer behavior to search for dealers and center/zoom the map to show the filtered results. However, since the behavior zooms to the exact layer extent, this means that markers can end up very close to (or even on) the edge of the map:

openlayers_zoomtolayer.jpg

Additionally, while it's a great tool to center the map on the results, there is no way to configure it too show more context..

To overcome this we've added an additional setting to the behavior that allows administrators to configure an additional scaling factor.

Files: 
CommentFileSizeAuthor
#2 1318078-openlayers-zoom-to-layer-margin-2.patch2.98 KBmr.baileys
PASSED: [[SimpleTest]]: [MySQL] 236 pass(es).
[ View ]
openlayers-zoomtolayer-margin.patch2.15 KBmr.baileys
PASSED: [[SimpleTest]]: [MySQL] 262 pass(es).
[ View ]
openlayers_zoomtolayer.jpg21.59 KBmr.baileys

Comments

Status:Needs review» Needs work

Hey @mr.baileys. Thanks for the batch; this is a cool feature. One thing you did not include was a default in the "options_init" method of the behavior class. This could potentially break everyone's map that has this behavior enabled.

Status:Needs work» Needs review
StatusFileSize
new2.98 KB
PASSED: [[SimpleTest]]: [MySQL] 236 pass(es).
[ View ]

Hi @zzolo, thanks for pointing that out. The original patch indeed breaks existing maps if the new setting is left unset. Updated patch attached.

Status:Needs review» Reviewed & tested by the community

I like this patch :-)

Thanks for the good idea mr.Baileys !

What do we need to do to bring this into this project?

Status:Reviewed & tested by the community» Fixed

Committed (sorry for the delay). http://drupalcode.org/project/openlayers.git/commit/db59242

Thanks so much for the patch.

Status:Fixed» Closed (fixed)

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

Issue summary:View changes

Updated issue summary.