$extentJs = $wmcGetApi->extentToJavaScript();
    $output[] = <<<JS
\t\tMapbender.events.afterInit.register(function () {
\t\t\t{$wmcJs};
\t\t});
\t\tMapbender.events.beforeInit.register(function () {
\t\t\t{$extentJs}
\t\t});
JS;
    Mapbender::session()->delete("wmcGetApi", $wmcGetApi);
} else {
    Mapbender::session()->set("wmcConstraints", $resultObj);
    $output = $wmc->wmsToJavaScript();
    $wmcJs = $wmc->toJavaScript(array());
    $wmcJs = implode(";\n", $wmcJs);
    $extentJs = $wmc->extentToJavaScript();
    $output[] = <<<JS
\t\tMapbender.events.afterInit.register(function () {
\t\t\t{$wmcJs};
\t\t});
\t\tMapbender.events.beforeInit.register(function () {
\t\t\t{$extentJs}
\t\t});
JS;
    Mapbender::session()->set("wmcGetApi", $wmcGetApi);
}
$outputString = "";
for ($i = 0; $i < count($output); $i++) {
    $outputString .= administration::convertOutgoingString($output[$i]);
}
$wmcFeaturetypeJson = $wmc->featuretypeConfToJavaScript();