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.
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
Comment #1
charlied CreditAttribution: charlied commentedSame for me.
Comment #2
zzolo CreditAttribution: zzolo commentedSame 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.
Comment #3
rokr CreditAttribution: rokr commentedThanks 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
Comment #4
bdragon CreditAttribution: bdragon commentedThe API documentation is still out of date. Yes, it needs updated.
Comment #5
bdragon CreditAttribution: bdragon commentedGMAP-ARRAY-DICTIONARY.txt by becw is a reasonably up-to-date explanation of the map array.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.