コード例 #1
0
     }
     if (strlen($map->getMetaData('wms_abstract')) > 0) {
         $layer->removeMetaData('wms_abstract');
     }
     if (strlen($map->getMetaData('wms_attribution_title')) > 0) {
         $layer->removeMetaData('wms_attribution_title');
     }
     if (strlen($map->getMetaData('wms_attribution_onlineresource')) > 0) {
         $layer->removeMetaData('wms_attribution_onlineresource');
     }
 }
 if (isset($_layer['projection'])) {
     $layer->setProjection($_layer['projection']);
 }
 if (isset($_layer['connectiontype'])) {
     $layer->setConnectionType($_layer['connectiontype']);
 }
 if (isset($_layer['connection']) && !empty($_layer['connection'])) {
     $layer->connection = $_layer['connection'];
 }
 if (isset($_layer['data']) && !empty($_layer['data'])) {
     $layer->data = $_layer['data'];
 }
 if (isset($_layer['filter']) && !empty($_layer['filter'])) {
     $layer->setFilter($_layer['filter']);
 }
 if (isset($_layer['group']) && !empty($_layer['group'])) {
     $layer->group = $_layer['group'];
 }
 if (isset($_layer['minscaledenom']) && strlen($_layer['minscaledenom']) > 0) {
     $layer->minscaledenom = floatval($_layer['minscaledenom']);
コード例 #2
0
ファイル: layer.php プロジェクト: samtux/MapFile-Generator
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();
        unset($map);
        header('Location: index.php');
        exit;
    } catch (MapScriptException $e) {
        $error = $e->getMessage();
    }