Closed (fixed)
Project:
GMap Module
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 May 2011 at 13:54 UTC
Updated:
21 May 2011 at 16:11 UTC
I'm trying to generate a map in node.tpl.php. The code I've used is this:
<?php
$map_array2 = array(
'id' => 'example',
'maptype' => 'Terrain',
'width' => '400px',
'height' => '400px',
'latitude' => 12.345,
'longitude' => 12.345,
'zoom' => 4,
'align' => 'left',
'controltype' => 'Small',
'markers' => array(
array(
'text' => 'First Marker',
'longitude' => 39.3739522204,
'latitude' => -81.5681648254,
'markername' => 'lblue',
),
array(
'text' => 'Second Marker',
'longitude' => 44.205835001,
'latitude' => -70.3674316406,
'markername' => 'orange',
),
),
);
$element2 = array(
'#type' => 'gmap',
'#gmap_settings' => $map_array2,
);
$output2 = drupal_render($element2);
echo $output2;
?>
as it says in the helpfile. The map is generated correctly, but no markers show up. I've applied the patch found here: http://drupal.org/node/1061444
but it still doesn't work. Has anyone else accomplished this?
Comments
Comment #1
Toxid commentedSorry, it works as should. I couldn't see the marker because the map was zoomed out.