Exemplo n.º 1
0
        $query = $tokens[1];
        $baseUrl = $tokens[0];
    }
    //If there is a query component to the initial url, append it to the end of the full url string
    if (strlen($query) == 0) {
        $url = sprintf("%s?SESSION=%s&MAPNAME=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", $baseUrl, $sessionId, $mapName, urlencode($webLayoutId), $dwf, $locale);
    } else {
        $url = sprintf("%s?SESSION=%s&MAPNAME=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s&%s", $baseUrl, $sessionId, $mapName, urlencode($webLayoutId), $dwf, $locale, $query);
    }
    $templ = file_get_contents("../viewerfiles/taskframe.templ");
    print sprintf($templ, $vpath . "tasklist.php", $locale, $url);
} catch (MgException $e) {
    OnError(GetLocalizedString("TASKS", $locale), $e->GetDetails());
    return;
} catch (Exception $ne) {
    OnError(GetLocalizedString("TASKS", $locale), $ne->getMessage());
    return;
}
function GetParameters($params)
{
    global $taskPane, $sessionId, $webLayoutId, $dwf, $locale, $mapName;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $webLayoutId = ValidateResourceId(GetParameter($params, 'WEBLAYOUT'));
    $dwf = GetIntParameter($params, 'DWF');
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
}
function GetRequestParameters()
{
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
        GetParameters($_POST);
Exemplo n.º 2
0
    $msg = $createdUpdatedStr . "<p><p>" . $featuresStr;
    //add warning message, if necessary
    if ($excludedLayers > 0) {
        $warningFmt = $excludedLayers > 1 ? GetLocalizedString("BUFFERREPORTWARNINGPLURAL", $locale) : GetLocalizedString("BUFFERREPORTWARNINGSINGULAR", $locale);
        $warningStr = sprintf($warningFmt, $excludedLayers);
        $msg = $msg . "<p><p>" . $warningStr;
    }
    // return the report page
    $templ = file_get_contents("../viewerfiles/bufferreport.templ");
    $templ = Localize($templ, $locale, GetClientOS());
    print sprintf($templ, $popup, $title, $msg);
} catch (MgException $e) {
    OnError(GetLocalizedString("BUFFERREPORTERRORTITLE", $locale), $e->GetDetails());
    return;
} catch (Exception $ne) {
    OnError(GetLocalizedString("BUFFERREPORTERRORTITLE", $locale), $ne->getMessage());
    return;
}
function OnError($title, $msg)
{
    global $target, $popup;
    $templ = Localize(file_get_contents("../viewerfiles/errorpage.templ"), $locale, GetClientOS());
    print sprintf($templ, $popup, $title, $msg);
}
function GetParameters()
{
    global $params, $selText, $locale;
    global $mapName, $sessionId, $bufferName, $lcolor, $ffcolor, $fbcolor, $layersParam, $popup;
    global $transparent, $distance, $units, $linestyle, $fillstyle, $thickness, $merge, $foretrans;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
Exemplo n.º 3
0
        } while ($features->ReadNext());
    } else {
        throw new SearchError(GetLocalizedString("SEARCHNOMATCHES", $locale), GetLocalizedString("SEARCHREPORT", $locale));
    }
} catch (MgException $ae) {
    if ($features) {
        // Close the feature reader
        $features->Close();
    }
    OnError($searchError, $ae->GetDetails());
} catch (SearchError $e) {
    if ($features) {
        // Close the feature reader
        $features->Close();
    }
    OnError($e->title, $e->getMessage());
}
//terminate the html document
echo "</table></body></html>";
// Set content length header
header("Content-Length:" . ob_get_length());
// Flush output buffer
ob_end_flush();
function OnError($title, $msg)
{
    global $target, $popup;
    $templ = file_get_contents("../viewerfiles/errorpage.templ");
    print sprintf($templ, $popup, $title, $msg);
}
function GetParameters($params)
{
Exemplo n.º 4
0
        $geomProp = new MgGeometryProperty("GEOM", $geomReader);
        $measureProps->Add($geomProp);
        $cmd = new MgInsertFeatures($featureName, $measureProps);
        $commands = new MgFeatureCommandCollection();
        $commands->Add($cmd);
        ReleaseReader($featureSrvc->UpdateFeatures($dataSourceId, $commands, false));
    }
    if ($layer != null) {
        $layer->ForceRefresh();
    }
    $map->Save($resourceSrvc);
} catch (MgException $e) {
    OnError(GetLocalizedString("MEASUREERROR", $locale), $e->GetDetails());
    return;
} catch (Exception $ne) {
    OnError(GetLocalizedString("MEASUREERROR", $locale), $ne->getMessage());
    return;
}
$templ = file_get_contents("../viewerfiles/measureui.templ");
$templ = Localize($templ, $locale, GetClientOS());
$vpath = GetSurroundVirtualPath();
print sprintf($templ, $locale, $target, $popup, $mapName, $sessionId, $total, $distance, 1, $units, $vpath . "measure.php", $vpath . "measure.php");
function OnError($title, $msg)
{
    global $target, $popup;
    $templ = Localize(file_get_contents("../viewerfiles/errorpage.templ"), $locale, GetClientOS());
    print sprintf($templ, $popup, $title, $msg);
}
function DataSourceExists($resourceSrvc, $dataSourceId)
{
    return $resourceSrvc->ResourceExists($dataSourceId);