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.
Hello
Thanks a lot for this module
I have tried to find a way to display the google map on a block but there is no option that allows me to. I need to display it on a block so that i can then include it on the contact page where the contact form/info is.
If possible, please help
Elvin Xhimitiku
Comment | File | Size | Author |
---|---|---|---|
#11 | locationmap.module.txt | 18.96 KB | vicksvaporub |
#8 | display_map_in_block-1267562-8.patch | 4.33 KB | BWPanda |
Comments
Comment #1
babbage CreditAttribution: babbage commentedThis is not a current feature of the module though it would be a good thing to be implemented in the future. Patches are of course welcome and will make it happen sooner.
If you need this functionality now, see the GMap module.
Comment #2
Elvin - Albania Drupal Developer CreditAttribution: Elvin - Albania Drupal Developer commentedThanks a lot babbage.
I have actually started using Gmap for a project i am currently building. But i needed to display only 1 gmap on a block for a small brochure site, and i didnt want to use gmap only for that.
Anyways thanks a lot
Elvin Xhimitiku
Drupal in Albania
Comment #3
babbage CreditAttribution: babbage commentedI totally agree that this is how Location Map should work, and you should not need GMap for something that simple. I'm just grossly over-committed so can't do the work anytime soon. :|
Comment #4
Elvin - Albania Drupal Developer CreditAttribution: Elvin - Albania Drupal Developer commentedDont worry man, it can wait :D
work comes first.
Best
Comment #5
BWPanda CreditAttribution: BWPanda commentedI'm confused...
This issue seems to indicate that you can't display a map in a block, and yet the project page says "Location Map will...create a block with a static image of the centre of your map, which links to the larger map."
Is it possible to display a map in a block or not?
Comment #6
vicksvaporub CreditAttribution: vicksvaporub commentedThe module creates a block with a static version of the map, just like a thumbnail.
I have another newbbie question ... can I add the map to a Panel?
Comment #7
BWPanda CreditAttribution: BWPanda commentedAh, ok. Changing the title to prevent further confusion then.
Comment #8
BWPanda CreditAttribution: BWPanda commentedTurns out I needed this functionality too. I therefore made the attached patch which allows you to select whether the LocationMap block will display a static image or an interactive map.
Let me know how this works for you.
Comment #9
vicksvaporub CreditAttribution: vicksvaporub commentedmmm... not working. I'm not sure if we are using the same LocationMap Module version, though.
I will check the patch again, maybe I have missed something while copying & pasting.
Comment #10
BWPanda CreditAttribution: BWPanda commentedThe patch was made against the 7.x-1.x branch of Git...
Comment #11
vicksvaporub CreditAttribution: vicksvaporub commentedIt's not working. Probably my fault (not very experienced in php programming) The map won't show (it works only if I choose the static version)
I attached my locationmap.module. I think I made all the changes needed, but may be missing something.
Comment #12
dropbydrop CreditAttribution: dropbydrop commented+1
please commit. thanks
Comment #13
sinini CreditAttribution: sinini commentedthere's an empty div being generated, but nothing is loaded into it... there might be only a small part missing from your original code? would be nice if you can have a look again...
Comment #14
sinini CreditAttribution: sinini commentedok i've got it:
just a fast try to get it working, (using API2):
in line 441 instead of:
just put
Comment #15
LeisureLarry CreditAttribution: LeisureLarry commentedThanks BWPanda. I've uploaded a patched version 1.1 to my git account:
https://github.com/LeisureLarry/Drupal7-Modules-Locationmap
It supports both API version 3 (just don't enter a key) and interactive blocks.
Comment #16
idflood CreditAttribution: idflood commentedI tried to apply the patch posted in #8 and it applies perfectly on the 7.x-2.x branch. It had a little warning about file permission, so maybe this should be changed before merging:
I'm using the block with panels and so far no issue found. Thanks @BWPanda!
Comment #17
rupertj CreditAttribution: rupertj commentedThanks BWPanda - I've committed this to the 2.x branch. It'll show up in 7.x-2.2 when it's released.
Comment #18
plamenut CreditAttribution: plamenut commentedPatch from #8 works against 7.x-2.1.
However, after patching it starts to trow an error :
Notice: Undefined variable: type in locationmap_block_image() (line 437 of /home/alphatan/public_html/elmagnifico/sites/all/modules/locationmap/locationmap.module).
the variable:
$type == 'interactive'
Caches cleared and update was run. Didn't try an uninstall/reinstall tough.
Thank everyone, BWPanda, especially.
Comment #19
rupertj CreditAttribution: rupertj commentedplamenut - Could you give the code from git a try? I just had a look there (where that patch is merged) and can't see how $type could end up undeclared.
If that works for you, I'll roll a 2.2 release.
Comment #20
cweagansI would also like to see an option presented for interactive/static image when the block is used in panels pages. If it would be accepted, I can open a separate issue and code it up.NEVERMIND. I guess you can just configure the block from the panels page =P
Comment #21
rupertj CreditAttribution: rupertj commentedNo reply, and the code is working for others, so closing this issue.