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

Toxid’s picture

Status: Active » Fixed

Sorry, it works as should. I couldn't see the marker because the map was zoomed out.

Status: Fixed » Closed (fixed)

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