I can successfully use GMap 5.x-0.5 (stable) or GMap 5.x-1.x-dev (unstable) with Drupal 5.1 to draw a Google map in macro mode.

But when I try to follow the example in API.txt to draw a map with the gmap_from_var() call, I get the error message:

GMap Module: DRAW_MAP CALLED -- This function is scheduled for deletion!

Looking at the code, I see the following comment:

/*
 * This function will be removed as soon as I can fix all the instances
 * where it was used in the past.
 * The reason for completely removing this function lies in the second parameter:
 * Allowing arbitrary javascript here is somewhat incompatible with the new way
 * of doing things and is terribly inefficient. The recommended method now is to
 * put your code in a js file that extends the javascript GMap API and drupal_add_js
 * it to the page during theming.
 */

So, if gmap_from_var() is deprecated, what are we to use in its place? Is macro mode the only permitted way to use GMap 5.x?

Thanks.

P.S. If this kind of stuff should go into the issues DB at http://drupal.org/project/issues/gmap?categories=support instead of the forums, please let me know -- I'm still finding my bearings here...

Comments

ray007’s picture

the gmap_draw_map() function is currently deprecated, use theme('gmap', array('#settings' => $map)); instead.

--
best regards
    Ray
----------------------------------------------------------
If you need a drupal developer contact me!

yecarrillo’s picture

I had been away for a long time ago. I need upgrade my gmap sites. Replacing

$mymap=array('id' => 'mymap',
             'latitude' => '49.19258642226091',
             'longitude'=>' -123.17647933959961',
             'zoom' => 13,
             'width' => '100%',
             'height' => '400px',
             'type' => 'Satellite',
);
echo gmap_draw_map($mymap);

With:

$mymap=array('id' => 'mymap',
             'latitude' => '49.19258642226091',
             'longitude'=>' -123.17647933959961',
             'zoom' => 13,
             'width' => '100%',
             'height' => '400px',
             'type' => 'Satellite',
);
theme('gmap', array('#settings' => $mymap)); 

Does not work. Help required!!

Only local images are allowed.

yecarrillo’s picture

I just missed "echo":

$mymap=array('id' => 'mymap',
             'latitude' => '49.19258642226091',
             'longitude'=>' -123.17647933959961',
             'zoom' => 13,
             'width' => '100%',
             'height' => '400px',
             'type' => 'Satellite',
);
echo theme('gmap', array('#settings' => $mymap));

Only local images are allowed.