Popups and Polygons

Events happening in the community are now at Drupal community events on www.drupal.org.
tom.camp's picture

I have created a world map with polygons overlaying certain countries using Drupal 6 and the gmap module. However, I cannot for the life of me figure out how to make those polygons clickable so when a user clicks on them they open a popup with the information about the country. Any help/thoughts would be appreciated.

$map = array(
    'id' => 'big_map',
    'width' => '940px',
    'height' => '405px',
    'latitude' => 20.0,
    'longitude' => 15.0,
    'zoom' => 2,
    'align' => 'left',
    'controltype' => 'None',
    'mtc' => 'none',
     
    'behavior' => array(
      'locpick' => FALSE,
      'nodrag' => FALSE,
      'nokeyboard' => FALSE,
      'overview' => FALSE,
      'scale' => FALSE,
      'dynmarkers' => TRUE,
      'nomousezoom' => TRUE,
      'clickableshapes' => TRUE,
    ),
   
    'shapes' => array(
      'type' => 'polygon',
      'points' => array( [latitudes and longitudes] ),
      'style' => array( 'b20838', 1, 80, 'b20838', 25 ),
      ),
  );

return theme( 'gmap', array( '#settings' => $map ) );

Thanks in advance.

Comments

Have you tried passing in a

8thom's picture

Have you tried passing in a text attribute to the shapes array?

I haven't tried doing this for polygons myself but I'd assume it would be the same as a marker.

eg.

'shapes' => array(
  'type' => 'polygon',
  'text' => '<popup text goes here>',
  'points' => array( [latitudes and longitudes] ),
  'style' => array( 'b20838', 1, 80, 'b20838', 25 ),
  ),

I have tried. It doesn't seem

tom.camp's picture

I have tried. It doesn't seem to have any effect. I did notice that on the Gmap settings page there is a Clickableshapes option, but it is disable and I don't know how to change it.

When in doubt, go downhill.

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: