From: osm@osm.rrze Date: Wed, 5 Dec 2012 10:00:41 +0000 (+0100) Subject: also support leaflet map if called under a filename containing -leaflet X-Git-Url: http://git.rrze.uni-erlangen.de/gitweb/?a=commitdiff_plain;h=25c0fde361609c019e460709c107ff0b6e09cdd4;p=osmrrze.git also support leaflet map if called under a filename containing -leaflet --- diff --git a/cgis/osm-map.pl b/cgis/osm-map.pl index 602efcd..f7999ca 100755 --- a/cgis/osm-map.pl +++ b/cgis/osm-map.pl @@ -5,6 +5,9 @@ # The file from which we get the Template for Openlayers? $openlayerstemplate = '/var/www/index.openlayers.html'; +# The file from which we get the Template for Openlayers? +$leaflettemplate = '/var/www/index.leaflet.html'; + # Your should not need to change anything below this line # ---------------------------------------------------------------------------- @@ -58,8 +61,12 @@ if (($lon == -999.0) && ($lat == -999.0)) { if ($mlat != -999.0) { $lat = $mlat; } if ($mlon != -999.0) { $lon = $mlon; } } +$mytemplate = $openlayerstemplate; # Openlayers +if ($0 =~ m/-leaflet/) { + $mytemplate = $leaflettemplate; # leaflet +} my $OLF; -unless (open($OLF, '<' . $openlayerstemplate)) { +unless (open($OLF, '<' . $mytemplate)) { print("Sorry, failed to read my map template.\n"); exit(0); } while ($ll = <$OLF>) {