Exemplo n.º 1
0
<?php

require_once GEOSERVER_PKG_PATH . 'geoserver_lib.php';
// user must be gmap admin
$gBitSystem->verifyPermission('p_gmap_admin');
// if changes are submitted process them first
if (isset($_REQUEST["batch_submit"])) {
    if (!empty($_REQUEST['cancel'])) {
        // user cancelled - just continue on, doing nothing
    } else {
        foreach ($_REQUEST['tilelayers'] as $tilelayer_id => $theme_id) {
            $storeHash = array('tilelayer_id' => $tilelayer_id, 'theme_id' => $theme_id);
            // if we dont do this the datakey html gets nulled
            $tilelayer = geoserverGetTilelayer($storeHash);
            $storeHash['datakey'] = $tilelayer['datakey'];
            // update the metadata
            geoserverStoreTilelayerMetaData($storeHash);
        }
    }
} elseif (isset($_REQUEST["themes_submit"])) {
    geoserverStoreThemes($_REQUEST);
}
// get list of tilelayers
$_REQUEST['max_records'] = '9999';
$tilelayers = geoserverGetTilelayerList($_REQUEST);
$gBitSmarty->assign('geoserverTilelayers', $tilelayers);
// get list of themes
$listHash = array();
$gBitSmarty->assign('geoserverTilelayerThemes', geoserverGetTilelayerThemes($listHash));
// $gBitSmarty->assign( 'listInfo', $_REQUEST['listInfo'] );
Exemplo n.º 2
0
        // if it already exists we'll update it
        if ($ret = geoserverGetTilelayer($tilelayerData)) {
            $tilelayerData['tilelayer_id'] = $ret['tilelayer_id'];
        }
        // store tilelayer
        if ($tilelayer = $gContent->storeTilelayer($tilelayerData)) {
            // store the tilelayer key html
            $gBitSmarty->assign('tilelayer', $tilelayer);
            // get its datakey legend html block
            $tilelayer['datakey'] = $gBitSmarty->fetch(GEOSERVER_PKG_PATH . 'templates/tilelayer_key.tpl');
            // if it already has been themed we preserve its theme mapping
            if (!empty($ret['theme_id'])) {
                $tilelayer['theme_id'] = $ret['theme_id'];
            }
            // store the tilelayer meta data
            geoserverStoreTilelayerMetaData($tilelayer);
            $rslts[] = 'Tile layer "' . $title . '" stored';
        } else {
            $rslts[] = 'Tile layer "' . $title . '" storage FAILED!';
        }
        // store data key html for tile layer
    } else {
        $rslts[] = 'Tile layer"' . $title . '" EXCLUDED!';
    }
}
// cache various tpls
geoserverRewriteTilelayerCache();
// report storage results
$centerContent = '';
foreach ($rslts as $rslt) {
    $centerContent .= "<p>" . $rslt . "</p>";