Ejemplo n.º 1
0
                                }
                            }
                            $map->save($mapfile);
                            header('Location: layer-class.php?layer=' . $_GET['layer']);
                            exit;
                        } catch (MapFile\Exception $e) {
                            $error = $e->getMessage();
                        }
                    }
                }
            }
        }
    }
}
$meta = mapfile_getmeta($mapfile);
$layers = mapfile_getlayers($mapfile);
$layer = $layers[intval($_GET['layer'])];
$class_json = json_encode($layer['class']);
page_header('Layer: ' . $layer['name']);
?>
<div class="container">
  <h1>Map: <a href="index.php"><?php 
echo htmlentities($meta['name']);
?>
</a></h1>
  <h2>Layer: <?php 
echo htmlentities($layer['name']);
?>
</h2>

  <?php 
Ejemplo n.º 2
0
            if (isset($_GET['remove'])) {
                $map->removeLayer(intval($_GET['remove']));
            } else {
                if (isset($_POST['action']) && $_POST['action'] == 'save') {
                    $map->name = trim($_POST['name']);
                    $map->projection = $_POST['projection'];
                    $map->setExtent($_POST['extentminx'], $_POST['extentminy'], $_POST['extentmaxx'], $_POST['extentmaxy']);
                }
            }
        }
    }
    $map->save($_SESSION['mapfile-generator']['mapfile']);
}
if (!isset($error)) {
    $meta = mapfile_getmeta($_SESSION['mapfile-generator']['mapfile']);
    $layers = mapfile_getlayers($_SESSION['mapfile-generator']['mapfile']);
}
page_header();
?>
<div class="container">
  <?php 
if (isset($error)) {
    echo '<div class="alert alert-danger" role="alert"><strong>Error :</strong> ' . $error . '</div>';
}
?>

  <form action="index.php" method="post" autocomplete="off">
    <div class="row">
      <div class="form-group form-group-lg col-sm-6">
        <label for="inputName">Map name</label>
        <input type="text" class="form-control" id="inputName" name="name" value="<?php