if (isset($_GET['down']) || isset($_GET['up']) || isset($_GET['remove'])) { try { $map = new MapFile\Map($mapfile); $l = $map->getLayer(intval($_GET['layer'])); if (isset($_GET['down'])) { $l->moveClassDown(intval($_GET['down'])); } else { if (isset($_GET['up'])) { $l->moveClassUp(intval($_GET['up'])); } else { if (isset($_GET['remove'])) { $l->removeClass(intval($_GET['remove'])); } } } $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']);
} else { if (isset($_GET['down'])) { $map->moveLayerDown(intval($_GET['down'])); } else { 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">