From 25c0fde361609c019e460709c107ff0b6e09cdd4 Mon Sep 17 00:00:00 2001 From: "osm@osm.rrze" Date: Wed, 5 Dec 2012 11:00:41 +0100 Subject: [PATCH] also support leaflet map if called under a filename containing -leaflet --- cgis/osm-map.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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>) { -- 2.25.1