also support leaflet map if called under a filename containing -leaflet
authorosm@osm.rrze <osm@osm.rrze.uni-erlangen.de>
Wed, 5 Dec 2012 10:00:41 +0000 (11:00 +0100)
committerosm@osm.rrze <osm@osm.rrze.uni-erlangen.de>
Wed, 5 Dec 2012 10:00:41 +0000 (11:00 +0100)
cgis/osm-map.pl

index 602efcdec5db406e2ccb6c77aeb1a3f8a3c6f297..f7999cac355df54e7e88ac34c29ab2a17001152f 100755 (executable)
@@ -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>) {
This page took 0.203614 seconds and 4 git commands to generate.