Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1318078-openlayers-zoom-to-layer-margin-2.patch | 2.98 KB | mr.baileys |
openlayers-zoomtolayer-margin.patch | 2.15 KB | mr.baileys | |
openlayers_zoomtolayer.jpg | 21.59 KB | mr.baileys |
Comments
Comment #1
zzolo CreditAttribution: zzolo commentedHey @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.
Comment #2
mr.baileysHi @zzolo, thanks for pointing that out. The original patch indeed breaks existing maps if the new setting is left unset. Updated patch attached.
Comment #3
PolI like this patch :-)
Thanks for the good idea mr.Baileys !
Comment #4
mgiffordWhat do we need to do to bring this into this project?
Comment #5
zzolo CreditAttribution: zzolo commentedCommitted (sorry for the delay). http://drupalcode.org/project/openlayers.git/commit/db59242
Thanks so much for the patch.
Comment #6.0
(not verified) CreditAttribution: commentedUpdated issue summary.