Download & Extend

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

Project:GMap Module
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

Same for me.

#2

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

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

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

#5

Status:active» fixed

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

#6

Status:fixed» closed (fixed)

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