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.
Here is my simple patch to add a "Directions" button to the popup window on a geofield map display. I added a new option called "Show a Directions link" in the widget options, and it adds a link that opens to google maps in a new window.
Comment | File | Size | Author |
---|---|---|---|
#10 | geofield-link-1966986-10-d7.patch | 3.39 KB | ntsekov |
#9 | 0001-Directions-link.patch | 3.35 KB | harrrrrrr |
#1 | Screenshot from 2013-04-10 13:08:00.png | 45.46 KB | mariacha1 |
add_directions_button.patch | 3.08 KB | mariacha1 | |
Comments
Comment #1
mariacha1 CreditAttribution: mariacha1 commentedHere's a screenshot of the link, as well.
Comment #2
klucid CreditAttribution: klucid commentedWorks great. Thanks for the patch!
Comment #3
vlyalko CreditAttribution: vlyalko commentedI cannot seem to be able to find where to set this Show a Directions parameter. Can you please assist? Thank you
Comment #4
vlyalko CreditAttribution: vlyalko commentedI have found where I can set the show direction property, but even if it is checked, the link is still not showing up. Can you please help? Thank you
Comment #5
cosmo.kramer CreditAttribution: cosmo.kramer commentedHow do I install it?
Comment #6
eudaemonia CreditAttribution: eudaemonia commentedYou can follow directions here to use cygwin to apply the patch. Once you've uploaded the patched files to your server, be sure you update.php.
Create a content type, use addressfield to collect location data, and use geofield to "geocode from another field" (that's the widget you should choose when you add a geofield to your content type).
In "Manage Display," for geofield, choose geofield map. When you click settings for the display (the little gear to the right) you'll see a "Show a Directions Link" check box at the bottom of the list. Check it. Be sure to hit "Save" on the "Manage Display" link and you're done.
Comment #7
RKopacz CreditAttribution: RKopacz commentedI'm looking for something like this, but note that this issue is over a year and a half old. I am using the current release of Geofield. Will the patch work on that now? Will have a look at it myself but if someone knows would appreciate an update.
thanks
Comment #8
troybthompson CreditAttribution: troybthompson commentedI have other patches so I installed this manually, but it worked great. Thank you! A badly needed feature.
Comment #9
harrrrrrr CreditAttribution: harrrrrrr commentedTested & works.
Patch against current version attached.
Comment #10
ntsekov CreditAttribution: ntsekov commentedUpdated text link to View on Google Maps and added class map-direction to link if you want to add some style for it.