$map->legend->label->size = 8.0; $map->scalebar->label->type = MS_TRUETYPE; $map->scalebar->label->font = $settings['font']; $map->scalebar->label->size = 8.0; $map->scalebar->units = MS_KILOMETERS; $map->scalebar->color->setRGB(0, 0, 0); $map->scalebar->outlinecolor->setRGB(0, 0, 0); if (isset($_POST['layers']) && is_array($_POST['layers'])) { foreach ($_POST['layers'] as $i => $_layer) { if (!isset($_layer['name']) || empty($_layer['name'])) { continue; } try { $layer = $map->getLayer($i); } catch (MapScriptException $e) { $layer = new layerObj($map); } if (isset($_layer['type'])) { $layer->type = intval($_layer['type']); } if (isset($_layer['name'])) { $layer->name = trim($_layer['name']); } if (isset($_POST['wms']) && $_POST['wms'] == 1) { /*if (empty($_layer['request'])) { $layer->setMetadata('wms_enable_request', 'none'); } else { $r = '*'; if (!in_array('GetCapabilities', $_layer['request'])) $r.= ' !GetCapabilities'; if (!in_array('GetMap', $_layer['request'])) $r.= ' !GetMap'; if (!in_array('GetFeatureInfo', $_layer['request'])) $r.= ' !GetFeatureInfo';
if (is_null($mapfile)) { header('Location:index.php'); exit; } $meta = mapfile_getmeta($mapfile); $layers = mapfile_getlayers($mapfile); if (isset($_GET['layer'])) { $layer = $layers[intval($_GET['layer'])]; } if ($mapscript && isset($_POST['action']) && $_POST['action'] == 'save') { try { $map = new mapObj($mapfile); if (isset($_GET['layer'])) { $layer = $map->getLayer(intval($_GET['layer'])); } else { $layer = new layerObj($map); } $layer->tileitem = NULL; $layer->type = intval($_POST['type']); $layer->name = trim($_POST['name']); $layer->setProjection($_POST['projection']); $layer->setConnectionType($_POST['connectiontype']); $layer->connection = $_POST['connection']; $layer->data = $_POST['data']; $layer->filteritem = $_POST['filteritem']; $layer->setFilter($_POST['filter']); $layer->group = $_POST['group']; $layer->free(); unset($layer); $map->save($mapfile); $map->free();