|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
|