Hi,
I managed to call a gmap overlay in a node using a text field with gmap filter.
However I'd like to call the map directly from the node template file. Scenario:
I have created a cck file field to upload a kml file and I call the map directly without having to enter anything in a text box.
Using regular gmap module, we can use:

$mymap=array('id' => 'mymap',
             'latitude' => '49.19258642226091',
             'longitude'=>' -123.17647933959961',
             'zoom' => 13,
             'width' => '100%',
             'height' => '400px',
             'type' => 'Satellite',
);
echo theme('gmap', array('#settings' => $mymap));

How can we extend that function to call the overlay?
Other solution: keep a dummy text box and call the gmap formatter. But this requires to enter at least one character in the dummy text box and select gmap formatter to work...
<?php
$macro = "[gmap |overlay=clientsidekml:/".$node->field_kml_file[0]['filepath']."| zoom=3 |width=100% |height=200px |control=Large |type=aerial]";
$node->field_map_macro[0]['value'] = $macro;
echo content_format('field_map_macro', $node->field_map_macro[0], 'default', $node);

thanks for your help

Comments

bdragon’s picture

$mymap['overlay'][] = array(
  'type' => 'clientsidekml',
  'url' => $node->field_kml_file[0]['filepath'],
);