I'm going to build a custom block to show locative information. Later on this piece of code should be moved into the node template. I read a lot and ended up with this code for a block:

if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load($nid);
$latitude = $node->location['latitude'];
$longitude = $node->location['longitude'];
$mymap=array('id' => 'mymap',
             'latitude' => $latitude,
             'longitude'=>$longitude,
             'zoom' => 10,
             'control' => 'Small',
             'tcontrol' => 'off',
             'width' => '100%',
             'height' => '250px',
             'type' => 'Satellite',
             'markers' => array(array('latitude' => $latitude,'longitude'=>$longitude))
);
print theme('gmap', array('#settings' => $mymap));
}

This works but in this special case 'control', 'tcontrol' and 'type' are ignored. So the control is always large and the map type is 'map'. To make sure this was not fixed already i updatet from alpha1 to the latest 5.x-1.x-dev (2008-Mar-19) but the behaviour still appears. Am i doing something wrong, is there already an issue or did i miss anything else?

Thanks, Ronald

Comments

charlied’s picture

Same for me.

zzolo’s picture

Same problem with me. But the following works:

use 'controltype' instead of 'control'
and 'maptype' instead of 'type'

Either the API documentation needs to be updated, or the code rewritten. I am not sure of the desired direction.

rokr’s picture

Thanks for the hint (it worked for me). I referred to api.txt in module folder and this wiki page: http://groups.drupal.org/node/6949
As it seems the docs should be updated.

cheers, Ronald

bdragon’s picture

The API documentation is still out of date. Yes, it needs updated.

bdragon’s picture

Status: Active » Fixed

GMAP-ARRAY-DICTIONARY.txt by becw is a reasonably up-to-date explanation of the map array.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.