I pass all the required variables for $map and the map shows up great EXCEPT the location marker doesn't show up. Anyone else having this problem or know how to address this? Thanks.

Comments

nashINATOR’s picture

I have a similar problem. If you find a solution please post something here and i will do likewise.
Cheers
Nash

nashINATOR’s picture

I have a similar problem. If you find a solution please post something here and i will do likewise.
Cheers
Nash

nashINATOR’s picture

i finally got the location marker to show but i cant get an info window to open. Some advise would be great. attached below is the code i changed to get it to work. Its probably a bug: I wouldnt have a clue how to fix it but if its just a work around you are looking for here goes:.

  
$mymarkers=array(
                 array(
                       'label' => 'BLAH BLAH',
                       'latitude' => '40.0',
                       'longitude'=> '-168.0'
                        )
                                 );

$mymap=array('id' => 'mymap',
             'latitude' => $node->location['latitude'],
             'longitude'=> $node->location['longitude'],
             'zoom' => 14,
             'width' => '100%',
             'height' => '400px',
             'type' => 'Map',
             'markers' => $mymarkers);
              
echo theme('gmap', array('#settings' => $mymap));


yES I KNOW IT LOOKS STUPID BUT THE ONLY WAY I COULD GET IT TO WORK WAS BY PUTING IT IN ANOTHER ARRAY.
SORRry about the caps its 4:38 in the morning and i am really tiered.
Best of luck: if you come up with a solution for the label please let me know, it woud be much appreciated.
Cheers
Nash

nashINATOR’s picture

Haha good thing i stayed awake longer. Figured it out. Google maps displays tooltips and popups. Instead of a tool tip i found what a pop was defined as in the array.
So in the above code replace:
'label' with 'text'

That should do the trick.
Best of luck.
Nash

robomalo’s picture

Unfortunately I haven't found a solution. I will definitely be searching this weekend. If I find a fix I'll post it here.

robomalo’s picture

Haha. I went to the URL in my e-mail to reply without checking this page first. I can't wait to fix my site! It seems weird that you have to put the long and lat twice: once for the markers, and once for the map. You have been very helpful. Thanks.

nashINATOR’s picture

Lol! I know what you mean about implementing it. I was pretty excited when i figured it out.
well yes about referring to long and lat twice its so that you can you can have a marker and the center of the map. In my case the marker is the center of the map.
Cheers
Nash
Let me know how you went with the site.

robomalo’s picture

YES! That worked! Thanks so much. What did you reference to figure this out? I would like to know all the available variables.

bdragon’s picture

Title: Markers do not appear with theme('gmap', array('#settings' => $map)) » Document marker keys
Version: 5.x-0.6 » 5.x-1.x-dev
Component: Code » Documentation
Category: bug » task

All the possible marker keys need to be documented properly.

bdragon’s picture

Status: Active » Closed (duplicate)

Adding this issue to my documentation rollup issue.

Marking as duplicate of http://drupal.org/node/181208.
Thank you for your issue.