API ignoring some values (e.g. 'control')

rkr - March 19, 2008 - 16:45
Project:GMap Module
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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:

<?php
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

#1

charlied - March 21, 2008 - 20:31

Same for me.

#2

zzolo - March 23, 2008 - 02:02

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.

#3

rkr - March 23, 2008 - 20:39

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

#4

bdragon - June 30, 2008 - 23:36

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

#5

bdragon - September 30, 2008 - 16:23
Status:active» fixed

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

#6

Anonymous (not verified) - October 14, 2008 - 16:32
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.