diff --git a/HexGrid/Pin.pm b/HexGrid/Pin.pm index 79d5d1d..1e2207d 100644 --- a/HexGrid/Pin.pm +++ b/HexGrid/Pin.pm @@ -11,6 +11,7 @@ has id => (is => 'ro', required => 1); has icon => (is => 'rw', alias => [qw(img source src)], required => 1); has link => (is => 'rw', alias => 'href'); has description => (is => 'rw', alias => 'desc'); +has popup => (is => 'rw', default => 1, alias => 'use_popup'); has popup_class => (is => 'rw', default => 'pin-popup'); @@ -20,14 +21,16 @@ sub render($this, $pin_container, $x, $y, $w, $h, $laters = undef) my $element = $group->use(href => "#$this->{icon}_symbol", x => $x, y => $y, width => $w, height => $h); $element->{id} = "$this->{id}-use"; - $element->{onclick} = "clickPin('$this->{id}', '$pin_container->{id}');"; + $element->{onclick} = "clickPin('$this->{id}', '$pin_container->{id}');" + if $this->popup; my $center_x = $x + $w/2; my $center_y = $y + $h/2; if(defined $laters) { push @$laters, sub ($popup_container) { $this->render_popup($popup_container, - $pin_container->{transform}, $center_x, $center_y); }; + $pin_container->{transform}, $center_x, $center_y); } + if $this->popup; } return $group; } diff --git a/wiki-map.pl b/wiki-map.pl index bb2b9c0..bfe8ae2 100644 --- a/wiki-map.pl +++ b/wiki-map.pl @@ -376,7 +376,8 @@ foreach my $site_page_ref (values %{$site_query_results->{query}{pages}}) id => HexGrid::to_id($site_name), icon => HexGrid::to_id($parsed_template->{named_params}{icon}), link => $site_url, - description => $parsed_template->{named_params}{abstract} + description => $parsed_template->{named_params}{abstract}, + popup => $html_document ); $tile->pin($pin); }