X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=tiles.pl;h=31f8fec2524f7f4faf8b8105383d4ea7119a8902;hb=fba830ce019d1307afe8b8e3a92f3a4fcc797d9f;hp=a8d699885637d899bb228f3a1401779f3791159e;hpb=32a78b5ea8ec99f5e237a5bfea4c9467a695dace;p=google-map-tiles.git diff --git a/tiles.pl b/tiles.pl index a8d6998..31f8fec 100755 --- a/tiles.pl +++ b/tiles.pl @@ -69,10 +69,12 @@ if ( !(-e $icon1) or !(-e $icon2)) # Icon file missing - bad thing # (35,-89),(34,-90) -$dbh->do("drop table gvp_world_tiles") ; +eval { $dbh->do("drop table gvp_world_tiles") }; $dbh->do("create table gvp_world_tiles (zoom int2,tilex int4,tiley int4,latpix int4,lngpix int4)") ; -$sth = $dbh->prepare("select (volpnt)[0] as lat, (volpnt)[1] as lng from gvp_world") ; +my $sql = "select (volpnt)[0] as lat, (volpnt)[1] as lng from gvp_world" ; +$sql = "select (point)[0] as lat, (point) [1] as lng from geo_count" if $name =~ m/koha/; +$sth = $dbh->prepare( $sql ); $sth->execute ; @@ -183,6 +185,9 @@ while ( ($zoom,$tilex,$tiley) = $sth->fetchrow_array ) $imicon = $imicon1 ; } + my $custom_icon = "$name/icons/$zoom.png"; + $imicon = GD::Image->newFromPng( $custom_icon ) if -e $custom_icon; + $sti = $dbh->prepare("select latpix,lngpix from gvp_world_tiles where zoom = $zoom and tilex = $tilex and tiley = $tiley") ; $sti->execute ;