Closed (fixed)
Project:
GMap Module
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2008 at 16:45 UTC
Updated:
14 Oct 2008 at 16:32 UTC
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 commentedSame for me.
Comment #2
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
rokrThanks 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 commentedThe API documentation is still out of date. Yes, it needs updated.
Comment #5
bdragon commentedGMAP-ARRAY-DICTIONARY.txt by becw is a reasonably up-to-date explanation of the map array.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.