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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

babbage’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0
Priority: Major » Minor

This 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.

Elvin - Albania Drupal Developer’s picture

Thanks 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

babbage’s picture

I 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. :|

Elvin - Albania Drupal Developer’s picture

Dont worry man, it can wait :D
work comes first.

Best

BWPanda’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Priority: Minor » Normal

I'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?

vicksvaporub’s picture

The 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?

BWPanda’s picture

Title: I need to display the google map on a block on the Contact page » Display interactive map in a block/panel

Ah, ok. Changing the title to prevent further confusion then.

BWPanda’s picture

Status: Active » Needs review
FileSize
4.33 KB

Turns 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.

vicksvaporub’s picture

mmm... 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.

BWPanda’s picture

The patch was made against the 7.x-1.x branch of Git...

vicksvaporub’s picture

FileSize
18.96 KB

It'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.

dropbydrop’s picture

+1
please commit. thanks

sinini’s picture

there'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...

sinini’s picture

ok i've got it:

just a fast try to get it working, (using API2):

in line 441 instead of:

drupal_add_js('http://maps.google.com/maps/api/js?v=3&sensor=false',  array('type' => 'external', 'weight' => 5));

just put

drupal_add_js('http://maps.google.com/maps?file=api&hl=en&v=2&key=' . $gmap_key,  array('type' => 'external', 'weight' => 5));
LeisureLarry’s picture

Thanks 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.

idflood’s picture

I 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:

warning: locationmap.module has type 100755, expected 100644

I'm using the block with panels and so far no issue found. Thanks @BWPanda!

rupertj’s picture

Status: Needs review » Closed (fixed)

Thanks BWPanda - I've committed this to the 2.x branch. It'll show up in 7.x-2.2 when it's released.

plamenut’s picture

Version: 7.x-1.x-dev » 7.x-2.1
Category: feature » bug
Priority: Normal » Minor
Status: Closed (fixed) » Needs work

Patch 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.

rupertj’s picture

plamenut - 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.

cweagans’s picture

I 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

rupertj’s picture

Category: bug » feature
Priority: Minor » Normal
Status: Needs work » Closed (fixed)

No reply, and the code is working for others, so closing this issue.

  • Commit da491c4 on master, 7.x-2.x, 8.x-2.x authored by BWPanda:
    Issue #1267562 by elvin, BWPanda: Display interactive map in a block/...