]> mj.ucw.cz Git - gallery.git/commitdiff
GeoHack
authorMartin Mares <mj@ucw.cz>
Mon, 3 Feb 2014 09:30:31 +0000 (10:30 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 8 Feb 2015 20:14:18 +0000 (21:14 +0100)
Just experimenting...

gal/UCW/Gallery.pm
gal/UCW/Gallery/Web/HighSlide.pm

index 045b41f94f6e047c1a64c3c90b03d95e99e0d4f2..f4baa1fc6785633d005789f818751100643e09e3 100644 (file)
@@ -38,6 +38,9 @@ sub new($) {
                ParentURL => '../',
                BackURL => "",
                FwdURL => "",
+
+               # Hacks
+               GeoHack => 0,
        };
        return bless $self, $class;
 }
index bf0af46d93ba3ddf9570316be42ac5e6e2c3d1de..585b111a2dc6f2f63e8aab22c7147d8f1efda9ea 100644 (file)
@@ -5,6 +5,7 @@ package UCW::Gallery::Web::HighSlide;
 
 use strict;
 use warnings;
+use utf8;
 
 use UCW::Gallery;
 use UCW::Gallery::Web;
@@ -65,6 +66,13 @@ sub show_thumb($) {
        my $photo_url = $self->get('PhotoUrlPrefix') . $self->{gal}->photo_file_name($m, $photo_id);
        print "<li><a id='$aid' href='$click_url' class=highslide onclick='return hs.expand(this, { src: \"$photo_url\" })'>";
        print "<img src='$thumb' width=$tw height=$th alt='Photo'$tit></a>\n";
+       if ($self->get('GeoHack')) {
+               my ($lat, $lon) = ($m->{lat}, $m->{lon});
+               if (defined $lat && defined $lon) {
+                       my $cap = "<a href='http://www.openstreetmap.org/?mlat=$lat&amp;mlon=$lon#map=16/$lat/$lon'>Ukázat na mapě</a>";
+                       print "<div class='highslide-caption'>$cap</div>\n";
+               }
+       }
 }
 
 sub run($$) {