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:


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.

Members fund testing for the Drupal project. Drupal Association Learn more


zzolo’s picture

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.

mr.baileys’s picture

Status: Needs work » Needs review
2.98 KB

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

Pol’s picture

Status: Needs review » Reviewed & tested by the community

I like this patch :-)

Thanks for the good idea mr.Baileys !

mgifford’s picture

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

zzolo’s picture

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.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.