Merge pull request #2032 from lonvia/remove-ui

Remove HTML output
This commit is contained in:
Sarah Hoffmann 2020-11-01 15:12:12 +01:00 committed by GitHub
commit ce1c3bab6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3267 changed files with 49 additions and 2696 deletions

View File

@ -121,7 +121,6 @@ if (BUILD_API)
set(WEBSITESCRIPTS
website/deletable.php
website/details.php
website/hierarchy.php
website/lookup.php
website/polygons.php
website/reverse.php

View File

@ -30,7 +30,6 @@ unit tests (using PHPUnit). It has the following additional requirements:
* [behave test framework](https://behave.readthedocs.io) >= 1.2.5
* [nose](https://nose.readthedocs.io)
* [pytidylib](http://countergram.com/open-source/pytidylib)
* [phpunit](https://phpunit.de) >= 7.3
* [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)

View File

@ -252,13 +252,17 @@ function getIcon($aPlace)
*/
function getIconFile($aPlace)
{
if (CONST_MapIcon_URL === false) {
return null;
}
$sIcon = getIcon($aPlace);
if (!isset($sIcon)) {
return null;
}
return CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.p.20.png';
return CONST_MapIcon_URL.'/'.$sIcon.'.p.20.png';
}
/**

View File

@ -16,14 +16,6 @@ function userError($sMsg)
}
function exception_handler_html($exception)
{
http_response_code($exception->getCode());
header('Content-type: text/html; charset=UTF-8');
include(CONST_BasePath.'/lib/template/error-html.php');
exit();
}
function exception_handler_json($exception)
{
http_response_code($exception->getCode());
@ -41,14 +33,6 @@ function exception_handler_xml($exception)
exit();
}
function shutdown_exception_handler_html()
{
$error = error_get_last();
if ($error !== null && $error['type'] === E_ERROR) {
exception_handler_html(new Exception($error['message'], 500));
}
}
function shutdown_exception_handler_xml()
{
$error = error_get_last();
@ -73,10 +57,7 @@ function set_exception_handler_by_format($sFormat = null)
// one by default without an explicit $sFormat set.
if (!isset($sFormat)) {
set_exception_handler('exception_handler_html');
} elseif ($sFormat == 'html') {
set_exception_handler('exception_handler_html');
register_shutdown_function('shutdown_exception_handler_html');
set_exception_handler('exception_handler_json');
} elseif ($sFormat == 'xml') {
set_exception_handler('exception_handler_xml');
register_shutdown_function('shutdown_exception_handler_xml');

View File

@ -713,13 +713,8 @@ class SetupFunctions
@define('CONST_BasePath', '".CONST_BasePath."');
if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SETTINGS'));
@define('CONST_Database_DSN', '".CONST_Database_DSN."'); // or add ;host=...;port=...;user=...;password=...
@define('CONST_Database_DSN', '".CONST_Database_DSN."');
@define('CONST_Default_Language', ".(CONST_Default_Language ? ("'".CONST_Default_Language."'") : 'false').");
@define('CONST_Default_Lat', ".CONST_Default_Lat.");
@define('CONST_Default_Lon', ".CONST_Default_Lon.");
@define('CONST_Default_Zoom', ".CONST_Default_Zoom.");
@define('CONST_Map_Tile_URL', '".CONST_Map_Tile_URL."');
@define('CONST_Map_Tile_Attribution', '".CONST_Map_Tile_Attribution."'); // Set if tile source isn't osm.org
@define('CONST_Log_DB', ".(CONST_Log_DB ? 'true' : 'false').");
@define('CONST_Log_File', ".(CONST_Log_File ? ("'".CONST_Log_File."'") : 'false').");
@define('CONST_Max_Word_Frequency', '".CONST_Max_Word_Frequency."');
@ -733,8 +728,8 @@ if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SE
@define('CONST_Term_Normalization_Rules', \"".CONST_Term_Normalization_Rules."\");
@define('CONST_Use_Aux_Location_data', ".(CONST_Use_Aux_Location_data ? 'true' : 'false').");
@define('CONST_Use_US_Tiger_Data', ".(CONST_Use_US_Tiger_Data ? 'true' : 'false').");
@define('CONST_Website_BaseURL', '".CONST_Website_BaseURL."');
");
@define('CONST_MapIcon_URL', ".(CONST_MapIcon_URL ? ("'".CONST_MapIcon_URL."'") : 'false').');
');
info(CONST_InstallPath.'/settings/settings-frontend.php has been set up successfully');
}

View File

@ -1,135 +0,0 @@
<?php
header("content-type: text/html; charset=UTF-8");
?>
<?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/search.css" rel="stylesheet" type="text/css" />
</head>
<body id="reverse-page">
<?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
<div class="top-bar">
<form class="form-inline" role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>reverse.php">
<div class="form-group">
<input name="format" type="hidden" value="html">
lat
<input name="lat" type="text" class="form-control input-sm" placeholder="latitude" value="<?php echo $fLat; ?>" >
<a href="#" class="btn btn-default btn-xs" id="switch-coords" title="switch lat and lon">&lt;&gt;</a>
lon
<input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo $fLon; ?>" >
max zoom
<select name="zoom" class="form-control input-sm">
<option value="" <?php if ($iZoom === false) echo 'selected="selected"' ?> >--</option>
<?php
$aZoomLevels = array(
0 => "Continent / Sea",
1 => "",
2 => "",
3 => "Country",
4 => "",
5 => "State",
6 => "Region",
7 => "",
8 => "County",
9 => "",
10 => "City",
11 => "",
12 => "Town / Village",
13 => "",
14 => "Suburb",
15 => "",
16 => "Street",
17 => "",
18 => "Building",
19 => "",
20 => "",
21 => "",
);
foreach($aZoomLevels as $iZoomLevel => $sLabel)
{
$bSel = $iZoom === $iZoomLevel;
echo '<option value="'.$iZoomLevel.'"'.($bSel?' selected="selected"':'').'>'.$iZoomLevel.' '.$sLabel.'</option>'."\n";
}
?>
</select>
</div>
<div class="form-group search-button-group">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</div>
<div class="search-type-link">
<a href="<?php echo CONST_Website_BaseURL; ?>search.php">forward search</a>
</div>
</form>
</div>
<div id="content">
<?php if (count($aPlace)>0) { ?>
<div id="searchresults" class="sidebar">
<?php
$aResult = $aPlace;
echo '<div class="result" data-position="0">';
echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
echo ' <span class="name">'.htmlspecialchars($aResult['langaddress']).'</span>';
if (isset($aResult['label']))
echo ' <span class="type">('.$aResult['label'].')</span>';
else if ($aResult['type'] == 'yes')
echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
else
echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
echo '<p>'.$aResult['lat'].','.$aResult['lon'].'</p>';
echo detailsPermaLink($aResult, 'details', 'class="btn btn-default btn-xs details"');
echo '</div>';
?>
</div>
<?php } else { ?>
<div id="intro" class="sidebar">
Search for coordinates or click anywhere on the map.
</div>
<?php } ?>
<div id="map-wrapper">
<div id="map-position">
<div id="map-position-inner"></div>
<div id="map-position-close"><a href="#">hide</a></div>
</div>
<div id="map"></div>
</div>
</div> <!-- /content -->
<script type="text/javascript">
<?php
$aNominatimMapInit = array(
'zoom' => $iZoom !== false ? $iZoom : CONST_Default_Zoom,
'lat' => $fLat !== false ? $fLat : CONST_Default_Lat,
'lon' => $fLon !== false ? $fLon : CONST_Default_Lon,
'tile_url' => $sTileURL,
'tile_attribution' => $sTileAttribution
);
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';';
?>
</script>
<?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>
</body>
</html>

View File

@ -1,48 +0,0 @@
<?php
header("content-type: text/html; charset=UTF-8");
include(CONST_BasePath.'/lib/template/includes/html-header.php');
?>
<title>Nominatim Deleted Data</title>
<meta name="description" content="List of OSM data that has been deleted" lang="en-US" />
</head>
<body>
<div class="container">
<h1>Deletable</h1>
<p>
<?php echo sizeof($aPolygons) ?> objects have been deleted in OSM but are still in the Nominatim database.
Also available in <a href="<?php echo CONST_Website_BaseURL; ?>deletable.php?format=json">JSON format</a>.
</p>
<table class="table table-striped table-hover">
<?php
if (!empty($aPolygons)) {
echo '<tr>';
foreach (array_keys($aPolygons[0]) as $sCol) {
echo '<th>'.$sCol.'</th>';
}
echo '</tr>';
foreach ($aPolygons as $aRow) {
echo '<tr>';
foreach ($aRow as $sCol => $sVal) {
switch ($sCol) {
case 'osm_id':
echo '<td>'.osmLink($aRow).'</td>';
break;
case 'place_id':
echo '<td>'.detailsLink($aRow).'</td>';
break;
default:
echo '<td>'.($sVal?$sVal:'&nbsp;').'</td>';
break;
}
}
echo '</tr>';
}
}
?>
</table>
</div>
</body>
</html>

View File

@ -1,122 +0,0 @@
<?php
header("content-type: text/html; charset=UTF-8");
?>
<?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/details.css" rel="stylesheet" type="text/css" />
</head>
<?php
function osmMapUrl($aFeature)
{
if (isset($sFeature['error_x']) && isset($sFeature['error_y']))
{
$sBaseUrl = '//www.openstreetmap.org/';
$sOSMType = formatOSMType($aFeature['osm_type'], false);
if ($sOSMType)
{
$sBaseUrl += $sOSMType.'/'.$aFeature['osm_id'];
}
return '<a href="'.$sBaseUrl.'?mlat='.$aFeature['error_y'].'&mlon='.$aFeature['error_x'].'">view on osm.org</a>';
}
return '';
}
function josm_edit_url($aFeature)
{
$fWidth = 0.0002;
$sLon = $aFeature['error_x'];
$sLat = $aFeature['error_y'];
if (isset($sLat))
{
return "http://localhost:8111/load_and_zoom?left=".($sLon-$fWidth)."&right=".($sLon+$fWidth)."&top=".($sLat+$fWidth)."&bottom=".($sLat-$fWidth);
}
$sOSMType = formatOSMType($aFeature['osm_type'], false);
if ($sOSMType)
{
return 'http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/'.$sOSMType.'/'.$aFeature['osm_id'].'/full';
// Should be better to load by object id - but this doesn't seem to zoom correctly
// return " <a href=\"http://localhost:8111/load_object?new_layer=true&objects=".strtolower($aFeature['osm_type']).$sOSMID."\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
}
return '';
}
function potlach_edit_url($aFeature)
{
$fWidth = 0.0002;
$sLat = $aFeature['error_y'];
$sLon = $aFeature['error_x'];
if (isset($sLat))
{
return "//www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth);
}
return '';
}
?>
<body id="details-page">
<div class="container">
<div class="row">
<div class="col-md-6">
<h1><?php echo $aPointDetails['localname'] ?></h1>
<div class="locationdetails">
<h2 class="bg-danger">This object has an invalid geometry.</h2>
<div>
Type: <span class="type"><?php echo $aPointDetails['class'].':'.$aPointDetails['type'];?></span>
</div>
<div>
OSM: <span class="label"><?php echo osmLink($aPointDetails); ?><span>
</div>
<h4>Error</h4>
<p>
<?php echo $aPointDetails['errormessage']?$aPointDetails['errormessage']:'unknown'; ?>
</p>
<?php echo osmMapUrl($aPointDetails); ?>
<h4>Edit</h4>
<ul>
<?php if (josm_edit_url($aPointDetails)) { ?>
<li><a href="<?php echo josm_edit_url($aPointDetails); ?>" target="josm">Remote Control (JOSM / Merkaartor)</a></li>
<?php } ?>
<?php if (potlach_edit_url($aPointDetails)) { ?>
<li><a href="<?php echo potlach_edit_url($aPointDetails); ?>" target="potlatch2">Potlatch 2</a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="col-md-6">
<div id="map"></div>
</div>
</div>
<script type="text/javascript">
var nominatim_result = {
outlinestring: '<?php echo $aPointDetails['outlinestring'];?>',
lon: <?php echo isset($aPointDetails['error_x']) ? $aPointDetails['error_x'] : 0; ?>,
lat: <?php echo isset($aPointDetails['error_y']) ? $aPointDetails['error_y'] : 0; ?>
};
</script>
<?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>
</body>
</html>

View File

@ -1,268 +0,0 @@
<?php
header("content-type: text/html; charset=UTF-8");
?>
<?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/details.css" rel="stylesheet" type="text/css" />
</head>
<?php
function headline($sTitle)
{
echo "<tr class='all-columns'><td colspan='6'><h2>".$sTitle."</h2></td></tr>\n";
}
function headline3($sTitle)
{
echo "<tr class='all-columns'><td colspan='6'><h3>".$sTitle."</h3></td></tr>\n";
}
function format_distance($fDistance, $bInMeters = false)
{
if ($bInMeters) {
// $fDistance is in meters
if ($fDistance < 1) {
return '0';
}
elseif ($fDistance < 1000) {
return '<abbr class="distance" title="'.$fDistance.' meters">~'.(round($fDistance,0)).' m</abbr>';
}
else {
return '<abbr class="distance" title="'.$fDistance.' meters">~'.(round($fDistance/1000,1)).' km</abbr>';
}
} else {
if ($fDistance == 0) {
return '0';
} else {
return '<abbr class="distance" title="spheric distance '.$fDistance.'">'.(round($fDistance,4)).'</abbr>';
}
}
}
function kv($sKey,$sValue)
{
echo ' <tr><td>' . $sKey . '</td><td>'.$sValue.'</td></tr>'. "\n";
}
function hash_to_subtable($aAssociatedList)
{
$sHTML = '';
foreach ($aAssociatedList as $sKey => $sValue) {
$sHTML = $sHTML.' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>'."\n";
}
return $sHTML;
}
function map_icon($aPlace)
{
$sIcon = Nominatim\ClassTypes\getIconFile($aPlace);
if (isset($sIcon)) {
$sLabel = Nominatim\ClassTypes\getIcon($aPlace);
echo '<img id="mapicon" src="'.$sIcon.'" alt="'.$sLabel.'" />';
}
}
function _one_row($aAddressLine, $bDistanceInMeters = false){
$bNotUsed = isset($aAddressLine['isaddress']) && !$aAddressLine['isaddress'];
echo '<tr class="' . ($bNotUsed?'notused':'') . '">'."\n";
echo ' <td class="name">'.(trim($aAddressLine['localname'])!==null?$aAddressLine['localname']:'<span class="noname">No Name</span>')."</td>\n";
echo ' <td>' . $aAddressLine['class'].':'.$aAddressLine['type'];
if ($aAddressLine['type'] == 'administrative'
&& isset($aAddressLine['place_type']))
{
echo '('.$aAddressLine['place_type'].')';
}
echo "</td>\n";
echo ' <td>' . osmLink($aAddressLine) . "</td>\n";
echo ' <td>' . (isset($aAddressLine['rank_address']) ? $aAddressLine['rank_address'] : '') . "</td>\n";
echo ' <td>' . ($aAddressLine['admin_level'] < 15 ? $aAddressLine['admin_level'] : '') . "</td>\n";
echo ' <td>' . format_distance($aAddressLine['distance'], $bDistanceInMeters)."</td>\n";
echo ' <td>' . detailsPermaLink($aAddressLine,'details &gt;') . "</td>\n";
echo "</tr>\n";
}
function _one_keyword_row($keyword_token,$word_id){
echo "<tr>\n";
echo '<td>';
// mark partial tokens (those starting with a space) with a star for readability
echo ($keyword_token[0]==' '?'*':'');
echo $keyword_token;
if (isset($word_id))
{
echo '</td><td>word id: '.$word_id;
}
echo "</td></tr>\n";
}
?>
<body id="details-page">
<?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
<div class="container">
<div class="row">
<div class="col-sm-10">
<h1>
<?php echo $aPointDetails['localname'] ?>
</h1>
</div>
<div class="col-sm-2 text-right">
<?php map_icon($aPointDetails) ?>
</div>
</div>
<div class="row">
<div class="col-md-6">
<table id="locationdetails" class="table table-striped">
<?php
kv('Name' , hash_to_subtable($aPointDetails['aNames']) );
kv('Type' , $aPointDetails['class'].':'.$aPointDetails['type'] );
kv('Last Updated' , (new DateTime('@'.$aPointDetails['indexed_epoch']))->format(DateTime::RFC822) );
kv('Admin Level' , $aPointDetails['admin_level'] );
kv('Rank' , $aPointDetails['rank_search_label'] );
if ($aPointDetails['calculated_importance']) {
kv('Importance' , $aPointDetails['calculated_importance'].($aPointDetails['importance']?'':' (estimated)') );
}
kv('Coverage' , ($aPointDetails['isarea']?'Polygon':'Point') );
kv('Centre Point' , $aPointDetails['lat'].','.$aPointDetails['lon'] );
kv('OSM' , osmLink($aPointDetails) );
kv('Place Id (<a href="https://nominatim.org/release-docs/develop/api/Output/#place_id-is-not-a-persistent-id">on this server</a>)'
, $aPointDetails['place_id'] );
if ($aPointDetails['wikipedia'])
{
kv('Wikipedia Calculated' , wikipediaLink($aPointDetails) );
}
kv('Computed Postcode', $aPointDetails['postcode']);
kv('Address Tags' , hash_to_subtable($aPointDetails['aAddressTags']) );
kv('Extra Tags' , hash_to_subtable($aPointDetails['aExtraTags']) );
?>
</table>
</div>
<div class="col-md-6">
<div id="map"></div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Address</h2>
<table id="address" class="table table-striped table-responsive">
<thead>
<tr>
<td>Local name</td>
<td>Type</td>
<td>OSM</td>
<td>Address rank</td>
<td>Admin level</td>
<td>Distance</td>
<td></td>
</tr>
</thead>
<tbody>
<?php
foreach ($aAddressLines as $aAddressLine) {
_one_row($aAddressLine);
}
?>
<?php
if ($aLinkedLines)
{
headline('Linked Places');
foreach ($aLinkedLines as $aAddressLine) {
_one_row($aAddressLine, true);
}
}
if ($bIncludeKeywords)
{
headline('Name Keywords');
if ($aPlaceSearchNameKeywords) {
foreach ($aPlaceSearchNameKeywords as $aRow) {
_one_keyword_row($aRow['word_token'], $aRow['word_id']);
}
}
headline('Address Keywords');
if ($aPlaceSearchAddressKeywords) {
foreach ($aPlaceSearchAddressKeywords as $aRow) {
_one_keyword_row($aRow['word_token'], $aRow['word_id']);
}
}
}
if (!empty($aHierarchyLines))
{
headline('Parent Of');
$aGroupedAddressLines = array();
foreach ($aHierarchyLines as $aAddressLine) {
if ($aAddressLine['type'] == 'yes') $sType = $aAddressLine['class'];
else $sType = $aAddressLine['type'];
if (!isset($aGroupedAddressLines[$sType]))
$aGroupedAddressLines[$sType] = array();
$aGroupedAddressLines[$sType][] = $aAddressLine;
}
foreach ($aGroupedAddressLines as $sGroupHeading => $aHierarchyLines) {
$sGroupHeading = ucwords($sGroupHeading);
headline3($sGroupHeading);
foreach ($aHierarchyLines as $aAddressLine) {
_one_row($aAddressLine, true);
}
}
if (count($aHierarchyLines) >= 500) {
echo '<p>There are more child objects which are not shown.</p>';
}
}
echo "</table>\n";
?>
</div>
</div>
</div>
<script type="text/javascript">
<?php
$aNominatimMapInit = array(
'tile_url' => $sTileURL,
'tile_attribution' => $sTileAttribution
);
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
$aPlace = array(
'asgeojson' => $aPointDetails['asgeojson'],
'lon' => $aPointDetails['lon'],
'lat' => $aPointDetails['lat'],
);
echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';';
?>
</script>
<?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>
</body>
</html>

View File

@ -1,55 +0,0 @@
<?php
header("content-type: text/html; charset=UTF-8");
?>
<?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/details.css" rel="stylesheet" type="text/css" />
</head>
<body id="details-index-page">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Show details for place</h1>
<div class="search-form">
<h4>Search by place id</h4>
<form class="form-inline" action="details.php">
<input type="edit" class="form-control input-sm" pattern="^[0-9]+$" name="place_id" placeholder="12345" />
<input type="submit" class="btn btn-primary btn-sm" value="Show" />
</form>
</div>
<div class="search-form">
<h4>Search by OSM type and OSM id</h4>
<form id="form-by-type-and-id" class="form-inline" action="details.php">
<input type="edit" class="form-control input-sm" pattern="^[NWR][0-9]+$" placeholder="N123 or W123 or R123" />
<input type="hidden" name="osmtype" />
<input type="hidden" name="osmid" />
<input type="submit" class="btn btn-primary btn-sm" value="Show" />
</form>
</div>
<div class="search-form">
<h4>Search by openstreetmap.org URL</h4>
<form id="form-by-osm-url" class="form-inline" action="details.php">
<input type="edit" class="form-control input-sm" pattern=".*openstreetmap.*" placeholder="https://www.openstreetmap.org/relation/123" />
<input type="hidden" name="osmtype" />
<input type="hidden" name="osmid" />
<input type="submit" class="btn btn-primary btn-sm" value="Show" />
</form>
</div>
</div>
</div>
</div>
<?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>
</body>
</html>

View File

@ -1,60 +0,0 @@
<?php
$title = 'Internal Server Error';
if ( $exception->getCode() == 400 ) {
$title = 'Bad Request';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<style>
em { font-weight: bold; font-family: monospace; color: #e00404; background-color: #ffeaea; }
</style>
</head>
<body>
<h1><?php echo $title ?></h1>
<?php if (get_class($exception) == 'Nominatim\DatabaseError') { ?>
<p>Nominatim has encountered an internal error while accessing the database.
This may happen because the database is broken or because of a bug in
the software.</p>
<?php } else { ?>
<p>Nominatim has encountered an error with your request.</p>
<?php } ?>
<h3>Details</h3>
<?php echo $exception->getMessage() ?>
<?php if (CONST_Debug) { ?>
<p>
Exception <em><?php echo get_class($exception) ?></em> thrown in <em><?php echo $exception->getFile() . '('. $exception->getLine() . ')' ?></em>.
<?php if (get_class($exception) == 'Nominatim\DatabaseError') { ?>
<h3>SQL Error</h3>
<em><?php echo $exception->getSqlError() ?></em>
<pre><?php echo $exception->getSqlDebugDump() ?></pre>
<?php } ?>
<h3>Stack trace</h3>
<pre><?php echo $exception->getTraceAsString() ?></pre>
<?php } ?>
<p>
If you feel this error is incorrect feel file an issue on
<a href="https://github.com/openstreetmap/Nominatim/issues">Github</a>.
Please include the error message above and the URL you used.
</p>
</body>
</html>

View File

@ -1,15 +0,0 @@
<footer>
<p class="disclaimer">
Addresses and postcodes are approximate
</p>
<p class="copyright">
&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors
</p>
</footer>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/leaflet.min.js"></script>
<script src="js/Control.Minimap.min.js"></script>
<script src="js/url-search-params.js"></script>
<script src="js/nominatim-ui.js"></script>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>OpenStreetMap Nominatim: Search</title>
<meta content="IE=edge" http-equiv="x-ua-compatible" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="<?php echo CONST_Website_BaseURL;?>" />
<link href="css/leaflet.css" rel="stylesheet" />
<link href="css/Control.Minimap.min.css" rel="stylesheet" />
<link href="css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="css/bootstrap.min.css" rel="stylesheet" />

View File

@ -1,51 +0,0 @@
<header class="container-fluid">
<div class="row">
<div class="col-xs-4">
<div class="brand">
<a href="<?php echo CONST_Website_BaseURL;?>">
<img alt="logo" src="images/osm_logo.120px.png" width="30" height="30"/>
<h1>Nominatim</h1>
</a>
</div>
</div>
<div id="last-updated" class="col-xs-4 text-center">
<?php if (isset($sDataDate)){ ?>
Data last updated:
<br>
<?php echo $sDataDate; ?>
<?php } ?>
</div>
<div class="col-xs-4 text-right">
<div class="btn-group">
<button class="dropdown-toggle btn btn-sm btn-default" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
About &amp; Help <span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="https://nominatim.org/release-docs/develop/api/Overview/" target="_blank">API Reference</a></li>
<li><a href="https://nominatim.org/release-docs/develop/api/Faq/" target="_blank">FAQ</a></li>
<li><a href="https://help.openstreetmap.org/tags/nominatim/">OpenStreetMap Help</a></li>
<li><a href="https://github.com/openstreetmap/Nominatim">Nominatim on Github</a></li>
<li role="separator" class="divider"></li>
<li><a href="#" class="" data-toggle="modal" data-target="#report-modal">Report problem with results</a></li>
</ul>
</div>
</div>
</div>
</header>
<div class="modal fade" id="report-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Report a problem</h4>
</div>
<div class="modal-body">
<?php include(CONST_BasePath.'/lib/template/includes/report-errors.php'); ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>

View File

@ -1,9 +0,0 @@
<h2>Welcome to Nominatim</h2>
<p>Nominatim is a search engine for <a href="https://www.openstreetmap.org">OpenStreetMap</a>
data. This is the debugging interface. You may search for a name or address (forward search) or
look up data by its geographic coordinate (reverse search). Each result comes with a
link to a details page where you can inspect what data about the object is saved in
the database and investigate how the address of the object has been computed.</p>
For more information visit the <a href="https://nominatim.org">Nominatim home page</a>.

View File

@ -1,42 +0,0 @@
<p>
Before reporting problems please read the <a target="_blank" href="https://nominatim.org/release-docs/develop/api/Overview">user documentation</a>.
<h4>Finding the expected result</h4>
First of all, please make sure that the result that you expect is
available in the OpenStreetMap data.
To find the OpenStreetMap data, do the following:
<ul>
<li>Go to <a href="https://openstreetmap.org">https://openstreetmap.org</a>.</li>
<li>Go to the area of the map where you expect the result
and zoom in until you see the object you are looking for.</li>
<li>Click on the question mark on the right side of the map,
then with the question cursor on the map where your object is located.</li>
<li>Find the object of interest in the list that appears on the left side.</li>
<li>Click on the object and note down the URL that the browser shows.</li>
</ul>
If you cannot find the data you are looking for, there is a good chance
that it has not been entered yet. You should <a href="https://www.openstreetmap.org/fixthemap">report or fix the problem in OpenStreetMap</a> directly.
<h4>Reporting bad searches</h4>
Problems may be reported at the <a target="_blank" href="https://github.com/openstreetmap/nominatim/issues">issue tracker on github</a>. Please read through
the open tickets first and check if your problem has not already been
reported.
When reporting a problem, include the following:
<ul>
<li>A full description of the problem, including the exact term you
were searching for.</li>
<li>The result you get.</li>
<li>The OpenStreetMap object you expect to find (see above).</li>
</ul>
For general questions about installing and searching in Nominatim, please
use <a href="https://help.openstreetmap.org/tags/nominatim/">Help OpenStreetMap</a>.
</p>

View File

@ -1,71 +0,0 @@
<?php
header("content-type: text/html; charset=UTF-8");
include(CONST_BasePath.'/lib/template/includes/html-header.php');
?>
<title>Nominatim Broken Polygon Data</title>
<meta name="description" content="List of broken OSM polygon data by date" lang="en-US" />
</head>
<body>
<div class="container">
<h1>Broken polygons</h1>
<p>
Total number of broken polygons: <?php echo $iTotalBroken ?>.
Also available in <a href="<?php echo CONST_Website_BaseURL; ?>polygons.php?format=json">JSON format</a>.
</p>
<table class="table table-striped table-hover">
<?php
if (!empty($aPolygons)) {
echo '<tr>';
//var_dump($aPolygons[0]);
foreach (array_keys($aPolygons[0]) as $sCol) {
echo '<th>'.$sCol.'</th>';
}
echo '<th>&nbsp;</th>';
echo '</tr>';
$aSeen = array();
foreach ($aPolygons as $aRow) {
if (isset($aSeen[$aRow['osm_type'].$aRow['osm_id']])) continue;
$aSeen[$aRow['osm_type'].$aRow['osm_id']] = 1;
echo '<tr>';
$sOSMType = formatOSMType($aRow['osm_type']);
foreach ($aRow as $sCol => $sVal) {
switch ($sCol) {
case 'errormessage':
if (preg_match('/Self-intersection\\[([0-9.\\-]+) ([0-9.\\-]+)\\]/', $sVal, $aMatch)) {
$aRow['lat'] = $aMatch[2];
$aRow['lon'] = $aMatch[1];
$sUrl = sprintf('https://www.openstreetmap.org/?lat=%f&lon=%f&zoom=18&layers=M&%s=%d',
$aRow['lat'],
$aRow['lon'],
$sOSMType,
$aRow['osm_id']);
echo '<td><a href="'.$sUrl.'">'.($sVal?$sVal:'&nbsp;').'</a></td>';
} else {
echo '<td>'.($sVal?$sVal:'&nbsp;').'</td>';
}
break;
case 'osm_id':
echo '<td>'.osmLink(array('osm_type' => $aRow['osm_type'], 'osm_id' => $aRow['osm_id'])).'</td>';
break;
default:
echo '<td>'.($sVal?$sVal:'&nbsp;').'</td>';
break;
}
}
$sJosmUrl = 'http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/'.$sOSMType.'/'.$aRow['osm_id'].'/full';
echo '<td><a href="'.$sJosmUrl.'" target="josm">josm</a></td>';
echo '</tr>';
}
echo '</table>';
}
?>
</div>
</body>
</html>

View File

@ -1,139 +0,0 @@
<?php
header("content-type: text/html; charset=UTF-8");
?>
<?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/search.css" rel="stylesheet" type="text/css" />
</head>
<body id="search-page">
<?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
<div class="top-bar" id="structured-query-selector">
<div class="search-type-link">
<a id="switch-to-reverse" href="<?php echo CONST_Website_BaseURL; ?>reverse.php?format=html">reverse search</a>
</div>
<div class="radio-inline">
<input type="radio" name="query-selector" id="simple" value="simple">
<label for="simple">simple</label>
</div>
<div class="radio-inline">
<input type="radio" name="query-selector" id="structured" value="structured">
<label for="structured">structured</label>
</div>
<form role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php">
<div class="form-group-simple">
<input id="q" name="q" type="text" class="form-control input-sm" placeholder="Search" value="<?php echo htmlspecialchars($aMoreParams['q'] ?? ''); ?>" >
</div>
<div class="form-group-structured">
<div class="form-inline">
<input id="street" name="street" type="text" class="form-control input-sm" placeholder="House number/Street" value="<?php echo htmlspecialchars($aMoreParams['street'] ?? ''); ?>" >
<input id="city" name="city" type="text" class="form-control input-sm" placeholder="City" value="<?php echo htmlspecialchars($aMoreParams['city'] ?? ''); ?>" >
<input id="county" name="county" type="text" class="form-control input-sm" placeholder="County" value="<?php echo htmlspecialchars($aMoreParams['county'] ?? ''); ?>" >
<input id="state" name="state" type="text" class="form-control input-sm" placeholder="State" value="<?php echo htmlspecialchars($aMoreParams['state'] ?? ''); ?>" >
<input id="country" name="country" type="text" class="form-control input-sm" placeholder="Country" value="<?php echo htmlspecialchars($aMoreParams['country'] ?? ''); ?>" >
<input id="postalcode" name="postalcode" type="text" class="form-control input-sm" placeholder="Postal Code" value="<?php echo htmlspecialchars($aMoreParams['postalcode'] ?? ''); ?>" >
</div></div>
<div class="form-group search-button-group">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
<?php if (CONST_Search_AreaPolygons) { ?>
<input type="hidden" value="1" name="polygon_geojson" />
<?php } ?>
<input type="hidden" name="viewbox" value="<?php echo htmlspecialchars($aMoreParams['viewbox'] ?? ''); ?>" />
<div class="checkbox-inline">
<input type="checkbox" id="use_viewbox" <?php if (!empty($aMoreParams['viewbox'])) echo "checked='checked'"; ?>>
<label for="use_viewbox">apply viewbox</label>
</div>
</div>
</form>
</div>
<div id="content">
<?php if ($sQuery) { ?>
<div id="searchresults" class="sidebar">
<?php
$i = 0;
foreach($aSearchResults as $iResNum => $aResult)
{
echo '<div class="result" data-position=' . $i . '>';
echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
echo ' <span class="name">'.htmlspecialchars($aResult['name']).'</span>';
// echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lon'],3).'</span>';
// echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
if (isset($aResult['label']))
echo ' <span class="type">('.$aResult['label'].')</span>';
else if ($aResult['type'] == 'yes')
echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
else
echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
echo detailsPermaLink($aResult, 'details', 'class="btn btn-default btn-xs details"');
echo '</div>';
$i = $i+1;
}
if (!empty($aSearchResults) && $sMoreURL)
{
echo '<div class="more"><a class="btn btn-primary" href="'.htmlentities($sMoreURL).'">Search for more results</a></div>';
}
else
{
echo '<div class="noresults">No search results found</div>';
}
?>
</div>
<?php } else { ?>
<div id="intro" class="sidebar">
<?php include(CONST_BasePath.'/lib/template/includes/introduction.php'); ?>
</div>
<?php } ?>
<div id="map-wrapper">
<div id="map-position">
<div id="map-position-inner"></div>
<div id="map-position-close"><a href="#">hide</a></div>
</div>
<div id="map"></div>
</div>
</div> <!-- /content -->
<script type="text/javascript">
<?php
$aNominatimMapInit = array(
'zoom' => CONST_Default_Zoom,
'lat' => CONST_Default_Lat,
'lon' => CONST_Default_Lon,
'tile_url' => CONST_Map_Tile_URL,
'tile_attribution' => CONST_Map_Tile_Attribution
);
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
$sStructuredQuery = (empty($aMoreParams['q'])
&& !(empty($aMoreParams['street'])
&& empty($aMoreParams['city'])
&& empty($aMoreParams['county'])
&& empty($aMoreParams['state'])
&& empty($aMoreParams['country'])
&& empty($aMoreParams['postalcode'])))
? 'true' : 'false';
echo 'var nominatim_structured_query = '.$sStructuredQuery.';';
?>
</script>
<?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>
</body>
</html>

View File

@ -82,20 +82,16 @@ if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_Ins
// How long to sleep when no update could be found
@define('CONST_Replication_Recheck_Interval', '60');
// Website settings
// If true, send CORS headers to allow access
@define('CONST_NoAccessControl', true);
@define('CONST_Website_BaseURL', '/');
// Set this to the /mapicon directory of your nominatim-ui to enable returning
// icon URLs with the results.
@define('CONST_MapIcon_URL', false);
// Language to assume when none is supplied with the query.
// When set to false, the local language (i.e. the name tag without suffix)
// will be used.
@define('CONST_Default_Language', false);
// Appearance of the map in the debug interface.
@define('CONST_Default_Lat', 20.0);
@define('CONST_Default_Lon', 0.0);
@define('CONST_Default_Zoom', 2);
@define('CONST_Map_Tile_URL', 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
@define('CONST_Map_Tile_Attribution', ''); // Set if tile source isn't osm.org
@define('CONST_Search_AreaPolygons', true);
@ -103,7 +99,7 @@ if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_Ins
@define('CONST_Search_NameOnlySearchFrequencyThreshold', 500);
// If set to true, then reverse order of queries will be tried by default.
// When set to false only selected languages alloow reverse search.
// When set to false only selected languages allow reverse search.
@define('CONST_Search_ReversePlanForAll', true);
// Maximum number of OSM ids that may be queried at once

View File

@ -43,10 +43,10 @@ Feature: Object details
Then the result is valid json
Scenario Outline: HTML Details with keywords
When sending html details query for <osmid>
When sending json details query for <osmid>
| keywords |
| 1 |
Then the result is valid html
Then the result is valid json
Examples:
| osmid |

View File

@ -8,13 +8,9 @@ Feature: Object details
Examples:
| format | object |
| html | 492887 |
| json | 492887 |
| html | N4267356889 |
| json | N4267356889 |
| html | W230804120 |
| json | W230804120 |
| html | R123924 |
| json | R123924 |
Scenario Outline: Details via unknown OSM id
@ -23,21 +19,19 @@ Feature: Object details
Examples:
| format | object |
| html | 1 |
| json | 1 |
| html | R1 |
| json | R1 |
Scenario: Details with keywords
When sending details query for W78099902
| keywords |
| 1 |
Then the result is valid html
Then the result is valid json
# ticket #1343
Scenario: Details of a country with keywords
When sending details query for R287072
| keywords |
| 1 |
Then the result is valid html
Then the result is valid json

View File

@ -13,8 +13,6 @@ Feature: Simple Reverse Tests
Then the result is valid json
When sending geojson reverse coordinates <lat>,<lon>
Then the result is valid geojson
When sending html reverse coordinates <lat>,<lon>
Then the result is valid html
Examples:
| lat | lon |
@ -28,10 +26,6 @@ Feature: Simple Reverse Tests
| param | value |
| <parameter> | <value> |
Then the result is valid xml
When sending html reverse coordinates 53.603,10.041
| param | value |
| <parameter> | <value> |
Then the result is valid html
When sending xml reverse coordinates 53.603,10.041
| param | value |
| <parameter> | <value> |
@ -100,7 +94,6 @@ Feature: Simple Reverse Tests
| json |
| jsonv2 |
| geojson |
| html |
| xml |
Scenario: Missing lon parameter

View File

@ -7,10 +7,6 @@ Feature: Simple Tests
| param | value |
| <parameter> | <value> |
Then at least 1 result is returned
When sending html search query "Hamburg"
| param | value |
| <parameter> | <value> |
Then at least 1 result is returned
When sending xml search query "Hamburg"
| param | value |
| <parameter> | <value> |
@ -65,9 +61,7 @@ Feature: Simple Tests
Scenario Outline: Simple Searches
When sending search query "<query>"
Then the result is valid html
When sending html search query "<query>"
Then the result is valid html
Then the result is valid json
When sending xml search query "<query>"
Then the result is valid xml
When sending json search query "<query>"
@ -185,10 +179,6 @@ Feature: Simple Tests
| json_callback |
| 234 |
Then the result is valid xml
When sending html search query "Malibu"
| json_callback |
| 234 |
Then the result is valid html
Scenario: Empty JSON search
When sending json search query "YHlERzzx"
@ -209,14 +199,3 @@ Feature: Simple Tests
Then result header contains
| attr | value |
| more_url | .*&countrycodes=pl%2Cbo&.* |
Scenario Outline: Search with debug prints valid HTML
When sending html search query "<query>"
| extratags | addressdetails | namedetails | debug |
| 1 | 1 | 1 | 1 |
Then the result is valid html
Examples:
| query |
| 10, Alvierweg, 9490, Vaduz |
| Hamburg |

View File

@ -9,7 +9,6 @@ import os
import io
import re
import logging
from tidylib import tidy_document
import xml.etree.ElementTree as ET
import subprocess
from urllib.parse import urlencode
@ -119,23 +118,6 @@ class SearchResponse(GenericResponse):
if self.result is not None:
self.result = [r['geocoding'] for r in self.result]
def parse_html(self):
content, errors = tidy_document(self.page,
options={'char-encoding' : 'utf8'})
#eq_(len(errors), 0 , "Errors found in HTML document:\n%s" % errors)
self.result = []
b = content.find('nominatim_results =')
e = content.find('</script>')
if b >= 0 and e >= 0:
content = content[b:e]
b = content.find('[')
e = content.rfind(']')
if b >= 0 and e >= 0:
self.result = json.JSONDecoder(object_pairs_hook=OrderedDict)\
.decode(content[b:e+1])
def parse_xml(self):
et = ET.fromstring(self.page)
@ -176,19 +158,6 @@ class ReverseResponse(GenericResponse):
if errorcode == 200:
getattr(self, 'parse_' + fmt)()
def parse_html(self):
content, errors = tidy_document(self.page,
options={'char-encoding' : 'utf8'})
#eq_(len(errors), 0 , "Errors found in HTML document:\n%s" % errors)
b = content.find('nominatim_results =')
e = content.find('</script>')
content = content[b:e]
b = content.find('[')
e = content.rfind(']')
self.result = json.JSONDecoder(object_pairs_hook=OrderedDict).decode(content[b:e+1])
def parse_json(self):
m = re.fullmatch(r'([\w$][^(]*)\((.*)\)', self.page)
if m is None:
@ -251,11 +220,6 @@ class DetailsResponse(GenericResponse):
if errorcode == 200:
getattr(self, 'parse_' + fmt)()
def parse_html(self):
content, errors = tidy_document(self.page,
options={'char-encoding' : 'utf8'})
self.result = {}
def parse_json(self):
self.result = [json.JSONDecoder(object_pairs_hook=OrderedDict).decode(self.page)]
@ -408,9 +372,7 @@ def website_search_request(context, fmt, query, addr):
outp, status = send_api_query('search', params, fmt, context)
if fmt is None:
outfmt = 'html'
elif fmt == 'jsonv2 ':
if fmt is None or fmt == 'jsonv2 ':
outfmt = 'json'
else:
outfmt = fmt.strip()
@ -447,7 +409,7 @@ def website_details_request(context, fmt, query):
outp, status = send_api_query('details', params, fmt, context)
if fmt is None:
outfmt = 'html'
outfmt = 'json'
else:
outfmt = fmt.strip()
@ -508,9 +470,7 @@ def check_page_error(context, fmt):
context.execute_steps("Then a HTTP 400 is returned")
eq_(context.response.format, fmt)
if fmt == 'html':
assert_is_not_none(re.search(r'<html( |>).+</html>', context.response.page, re.DOTALL))
elif fmt == 'xml':
if fmt == 'xml':
assert_is_not_none(re.search(r'<error>.+</error>', context.response.page, re.DOTALL))
else:
assert_is_not_none(re.search(r'({"error":)', context.response.page, re.DOTALL))

View File

@ -186,13 +186,12 @@ fi #DOCS:
# You need to create a minimal configuration file that tells nominatim
# the name of your webserver user and the URL of the website:
# the name of your webserver user:
#DOCS:```sh
tee settings/local.php << EOF
<?php
@define('CONST_Database_Web_User', 'apache');
@define('CONST_Website_BaseURL', '/nominatim/');
EOF
#DOCS:```

View File

@ -180,13 +180,12 @@ fi #DOCS:
# You need to create a minimal configuration file that tells nominatim
# the name of your webserver user and the URL of the website:
# the name of your webserver user:
#DOCS:```sh
tee settings/local.php << EOF
<?php
@define('CONST_Database_Web_User', 'apache');
@define('CONST_Website_BaseURL', '/nominatim/');
EOF
#DOCS:```

View File

@ -160,16 +160,6 @@ EOFAPACHECONF
sudo a2enconf nominatim
sudo systemctl restart apache2
# You need to create a minimal configuration file that tells nominatim
# where it is located on the webserver:
#DOCS:```sh
tee settings/local.php << EOF
<?php
@define('CONST_Website_BaseURL', '/nominatim/');
EOF
#DOCS:```
# The Nominatim API is now available at `http://localhost/nominatim/`.
fi #DOCS:

View File

@ -161,16 +161,6 @@ EOFAPACHECONF
sudo a2enconf nominatim
sudo systemctl restart apache2
# You need to create a minimal configuration file that tells nominatim
# where it is located on the webserver:
#DOCS:```sh
tee settings/local.php << EOF
<?php
@define('CONST_Website_BaseURL', '/nominatim/');
EOF
#DOCS:```
# The Nominatim API is now available at `http://localhost/nominatim/`.
fi #DOCS:

View File

@ -1 +0,0 @@
.leaflet-control-minimap{border:rgba(255,255,255,1) solid;box-shadow:0 1px 5px rgba(0,0,0,.65);border-radius:3px;background:#f8f8f9;transition:all .6s}.leaflet-control-minimap a{background-color:rgba(255,255,255,1);background-repeat:no-repeat;z-index:99999;transition:all .6s}.leaflet-control-minimap a.minimized-bottomright{-webkit-transform:rotate(180deg);transform:rotate(180deg);border-radius:0}.leaflet-control-minimap a.minimized-topleft{-webkit-transform:rotate(0deg);transform:rotate(0deg);border-radius:0}.leaflet-control-minimap a.minimized-bottomleft{-webkit-transform:rotate(270deg);transform:rotate(270deg);border-radius:0}.leaflet-control-minimap a.minimized-topright{-webkit-transform:rotate(90deg);transform:rotate(90deg);border-radius:0}.leaflet-control-minimap-toggle-display{background-image:url(images/toggle.svg);background-size:cover;position:absolute;border-radius:3px 0 0}.leaflet-oldie .leaflet-control-minimap-toggle-display{background-image:url(images/toggle.png)}.leaflet-control-minimap-toggle-display-bottomright{bottom:0;right:0}.leaflet-control-minimap-toggle-display-topleft{top:0;left:0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.leaflet-control-minimap-toggle-display-bottomleft{bottom:0;left:0;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.leaflet-control-minimap-toggle-display-topright{top:0;right:0;-webkit-transform:rotate(270deg);transform:rotate(270deg)}.leaflet-oldie .leaflet-control-minimap{border:1px solid #999}.leaflet-oldie .leaflet-control-minimap a{background-color:#fff}.leaflet-oldie .leaflet-control-minimap a.minimized{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2)}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,35 +0,0 @@
header {
width: 100%;
padding: 5px 15px;
z-index: 5;
}
header .brand {
white-space: nowrap;
}
header .brand a:hover{
text-decoration: none;
}
header .brand h1 {
display: inline;
font-size: 1.5em;
color: #333;
}
header .brand > img {
display: inline-block;
margin-right: 5px;
margin-top: -5px;
}
header #last-updated {
font-size: 0.7em;
white-space: nowrap;
text-align: center;
}
header .dropdown-menu {
z-index: 1001;
}

View File

@ -1,76 +0,0 @@
h1 {
margin: 10px 0;
padding-left: 8px;
}
h1 small a {
font-size: 0.5em;
white-space: nowrap;
}
h2 {
font-size: 2em;
padding-left: 8px;
background-color: white;
}
h3 {
font-size: 1.5em;
padding-left: 8px;
}
tr.all-columns {
background-color: white !important;
border: none;
}
tr.all-columns td {
border-top: none !important;
padding-left: 0 !important;
}
.table {
width: 100%;
}
.table td {
font-size: 0.9em;
}
.table>thead>tr>td, .table>tbody>tr>td {
padding: 2px 8px;
}
.name{
font-weight: bold;
}
.notused{
color:#ddd;
}
.noname{
color:#800;
}
#map {
width:100%;
height:300px;
border: 1px solid #666;
}
#mapicon {
margin: 10px 0;
}
#details-index-page .search-form {
padding: 20px 10px;
margin: 2em 0;
}
#details-index-page .search-form h4 {
margin-top: 0;
}
#details-index-page .search-form .form-control{
width: 30em;
}
footer {
text-align: center;
padding: 2em 0;
font-size: 0.8em;
clear: both;
color: #333;
}
footer p {
margin: 1em;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="18" width="18"><defs><marker orient="auto" overflow="visible"><path d="M-2.6-2.828L-5.428 0-2.6 2.828.228 0-2.6-2.828z" fill-rule="evenodd" stroke="#000" stroke-width=".4pt"/></marker><marker orient="auto" overflow="visible"><g fill="none" stroke="#000" stroke-width=".8" stroke-linecap="round"><path d="M4.566 4.75L-.652 0"/><path d="M1.544 4.75L-3.674 0"/><path d="M-1.566 4.75L-6.784 0"/><path d="M4.566-5.013L-.652-.263"/><path d="M1.544-5.013l-5.218 4.75"/><path d="M-1.566-5.013l-5.218 4.75"/></g></marker><marker orient="auto" overflow="visible"><path d="M-5.6-5.657L-11.257 0-5.6 5.657.057 0-5.6-5.657z" fill-rule="evenodd" stroke="#000" stroke-width=".8pt"/></marker><marker orient="auto" overflow="visible"><path d="M4.616 0l-6.92 4v-8l6.92 4z" fill-rule="evenodd" stroke="#000" stroke-width=".8pt"/></marker><marker orient="auto" overflow="visible"><path d="M-10.69-4.437L1.328-.017l-12.018 4.42c1.92-2.61 1.91-6.18 0-8.84z" font-size="12" fill-rule="evenodd" stroke-width=".6875" stroke-linejoin="round"/></marker><marker orient="auto" overflow="visible"><path d="M-4.616 0l6.92-4v8l-6.92-4z" fill-rule="evenodd" stroke="#000" stroke-width=".8pt"/></marker><marker orient="auto" overflow="visible"><path d="M10 0l4-4L0 0l14 4-4-4z" fill-rule="evenodd" stroke="#000" stroke-width=".8pt"/></marker><marker orient="auto" overflow="visible"><path d="M10.69 4.437L-1.328.017l12.018-4.42c-1.92 2.61-1.91 6.18 0 8.84z" font-size="12" fill-rule="evenodd" stroke-width=".6875" stroke-linejoin="round"/></marker></defs><path d="M13.18 13.146v-5.81l-5.81 5.81h5.81z" stroke="#000" stroke-width="1.643"/><path d="M12.762 12.727l-6.51-6.51" fill="none" stroke="#000" stroke-width="2.482" stroke-linecap="round"/></svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,640 +0,0 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile {
will-change: opacity;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
border: none;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}

View File

@ -1,163 +0,0 @@
.top-bar {
width: 100%;
padding: 1em 15px;
}
.top-bar #q {
max-width: 500px;
}
@media (max-width: 850px) {
form #q {
min-width: 400px;
}
}
form .checkbox-inline {
margin-left: 10px;
}
form label {
font-weight: normal;
}
.search-type-link {
display: inline;
margin-right: 2em;
position: absolute;
right: 0
}
#switch-coords {
font-size: 0.8em;
font-weight: bold;
cursor: pointer;
}
.sidebar {
width: 25%;
padding: 15px;
padding-top: 0;
display: inline-block;
float: left;
}
#map-wrapper {
position: relative;
min-height: 500px;
width: 75%;
padding-right: 20px;
display: inline-block;
float: left;
}
#map {
height: 90%;
min-height: 500px;
background:#eee;
}
#map-position {
display: none;
position: absolute;
top: 0;
right: 20px;
padding: 0 5px;
color: #333;
font-size: 11px;
background-color: rgba(255, 255, 255, 0.7);
z-index: 500;
}
#map-position-close {
text-align: right;
}
.result {
font-size: 0.8em;
margin: 5px;
margin-top:0px;
padding: 4px 8px;
border-radius: 2px;
background:#F0F7FF;
border: 2px solid #D7E7FF;
cursor:pointer;
min-height: 5em;
}
.result.highlight {
background-color: #D9E7F7;
border-color: #9DB9E4;
}
.result.highlight .details {
margin: 10px auto;
display: block;
max-width: 10em;
}
.result img{
float: right;
}
.result .type{
color: gray;
font-size: 0.8em;
}
.result .details {
display: none;
}
.noresults{
text-align: center;
padding: 1em;
}
.more{
text-align:center;
margin-top: 1em;
}
footer {
text-align: center;
padding: 2em 0;
font-size: 0.8em;
clear: both;
color: #333;
}
footer p {
margin: 1em;
}
@media (max-width: 768px) {
#content {
top: 0;
position: relative;
}
#map-wrapper {
width: 100%;
max-height: 300px;
padding: 20px;
}
#map-position {
top: 20px;
right: 20px;
}
#map {
height: 300px;
}
.sidebar {
width: 100%;
}
.search-button-group {
display: inline;
}
}
.search-button-group {
margin-top: 3px;
box-sizing: content-box;
margin-bottom: 3px;
}
label {
font-weight: normal;
}

View File

@ -6,7 +6,7 @@ require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oParams = new Nominatim\ParameterParser();
$sOutputFormat = $oParams->getSet('format', array('html', 'json'), 'html');
$sOutputFormat = $oParams->getSet('format', array('json'), 'json');
set_exception_handler_by_format($sOutputFormat);
$oDB = new Nominatim\DB();
@ -24,7 +24,5 @@ if (CONST_Debug) {
}
if ($sOutputFormat == 'json') {
echo javascript_renderData($aPolygons);
} else {
include(CONST_BasePath.'/lib/template/deletable-html.php');
javascript_renderData($aPolygons);
}

View File

@ -8,7 +8,7 @@ ini_set('memory_limit', '200M');
$oParams = new Nominatim\ParameterParser();
$sOutputFormat = $oParams->getSet('format', array('html', 'json'), 'html');
$sOutputFormat = $oParams->getSet('format', array('json'), 'json');
set_exception_handler_by_format($sOutputFormat);
$aLangPrefOrder = $oParams->getPreferredLanguages();
@ -19,22 +19,17 @@ $iOsmId = $oParams->getInt('osmid', -1);
$sClass = $oParams->getString('class');
$bIncludeKeywords = $oParams->getBool('keywords', false);
$bIncludeAddressDetails = $oParams->getBool('addressdetails', $sOutputFormat == 'html');
$bIncludeAddressDetails = $oParams->getBool('addressdetails', false);
$bIncludeLinkedPlaces = $oParams->getBool('linkedplaces', true);
$bIncludeHierarchy = $oParams->getBool('hierarchy', $sOutputFormat == 'html');
$bIncludeHierarchy = $oParams->getBool('hierarchy', false);
$bGroupHierarchy = $oParams->getBool('group_hierarchy', false);
$bIncludePolygonAsGeoJSON = $oParams->getBool('polygon_geojson', $sOutputFormat == 'html');
$bIncludePolygonAsGeoJSON = $oParams->getBool('polygon_geojson', false);
$oDB = new Nominatim\DB();
$oDB->connect();
$sLanguagePrefArraySQL = $oDB->getArraySQL($oDB->getDBQuotedList($aLangPrefOrder));
if ($sOutputFormat == 'html' && !$sPlaceId && !$sOsmType) {
include(CONST_BasePath.'/lib/template/details-index-html.php');
exit;
}
if ($sOsmType && $iOsmId > 0) {
$sSQL = 'SELECT place_id FROM placex WHERE osm_type = :type AND osm_id = :id';
$aSQLParams = array(':type' => $sOsmType, ':id' => $iOsmId);
@ -252,11 +247,4 @@ if ($bIncludeKeywords) {
logEnd($oDB, $hLog, 1);
if ($sOutputFormat=='html') {
$sSQL = "SELECT TO_CHAR(lastimportdate,'YYYY/MM/DD HH24:MI')||' GMT' FROM import_status LIMIT 1";
$sDataDate = $oDB->getOne($sSQL);
$sTileURL = CONST_Map_Tile_URL;
$sTileAttribution = CONST_Map_Tile_Attribution;
}
include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php');

View File

@ -1,134 +0,0 @@
<?php
require_once(CONST_BasePath.'/lib/init-website.php');
require_once(CONST_BasePath.'/lib/log.php');
require_once(CONST_BasePath.'/lib/AddressDetails.php');
require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oParams = new Nominatim\ParameterParser();
$sOutputFormat = $oParams->getSet('format', array('html', 'json'), 'html');
$aLangPrefOrder = $oParams->getPreferredLanguages();
$sPlaceId = $oParams->getString('place_id');
$sOsmType = $oParams->getSet('osmtype', array('N', 'W', 'R'));
$iOsmId = $oParams->getInt('osmid', -1);
$oDB = new Nominatim\DB();
$oDB->connect();
$sLanguagePrefArraySQL = $oDB->getArraySQL($oDB->getDBQuotedList($aLangPrefOrder));
if ($sOsmType && $iOsmId > 0) {
$sPlaceId = $oDB->getOne("select place_id from placex where osm_type = '".$sOsmType."' and osm_id = ".$iOsmId." order by type = 'postcode' asc");
// Be nice about our error messages for broken geometry
if (!$sPlaceId) {
$sSQL = 'select osm_type, osm_id, errormessage, class, type,';
$sSQL .= " get_name_by_language(name,$sLanguagePrefArraySQL) as localname,";
$sSQL .= ' ST_AsText(prevgeometry) as prevgeom, ST_AsText(newgeometry) as newgeom';
$sSQL .= " from import_polygon_error where osm_type = '".$sOsmType;
$sSQL .= "' and osm_id = ".$iOsmId.' order by updated desc limit 1';
$aPointDetails = $oDB->getRow($sSQL);
if ($aPointDetails) {
if (preg_match('/\[(-?\d+\.\d+) (-?\d+\.\d+)\]/', $aPointDetails['errormessage'], $aMatches)) {
$aPointDetails['error_x'] = $aMatches[1];
$aPointDetails['error_y'] = $aMatches[2];
}
include(CONST_BasePath.'/lib/template/details-error-'.$sOutputFormat.'.php');
exit;
}
}
}
if (!$sPlaceId) userError('Please select a place id');
$iPlaceID = (int)$sPlaceId;
if (CONST_Use_US_Tiger_Data) {
$iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_tiger where place_id = '.$iPlaceID);
if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
}
if (CONST_Use_Aux_Location_data) {
$iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_aux where place_id = '.$iPlaceID);
if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
}
$oAddressLookup = new Nominatim\AddressDetails($oDB, $iPlaceID, -1, $aLangPrefOrder);
$aPlaceAddress = array_reverse($oAddressLookup->getAddressDetails());
if (empty($aPlaceAddress)) userError('Unknown place id.');
$aBreadcrums = array();
foreach ($aPlaceAddress as $i => $aPlace) {
if (!$aPlace['place_id']) continue;
$aBreadcrums[] = array(
'placeId' => $aPlace['place_id'],
'osmType' => $aPlace['osm_type'],
'osmId' => $aPlace['osm_id'],
'localName' => $aPlace['localname']
);
if ($sOutputFormat == 'html') {
$sPlaceUrl = 'hierarchy.php?place_id='.$aPlace['place_id'];
if ($i) echo ' &gt; ';
echo '<a href="'.$sPlaceUrl.'">'.$aPlace['localname'].'</a> ('.osmLink($aPlace).')';
}
}
if ($sOutputFormat == 'json') {
header('content-type: application/json; charset=UTF-8');
$aDetails = array();
$aDetails['breadcrumbs'] = $aBreadcrums;
javascript_renderData($aDetails);
exit;
}
$aRelatedPlaceIDs = $oDB->getCol("select place_id from placex where linked_place_id = $iPlaceID or place_id = $iPlaceID");
$sSQL = 'select obj.place_id, osm_type, osm_id, class, type, housenumber, admin_level,';
$sSQL .= " rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, st_area(geometry) as area, ";
$sSQL .= " get_name_by_language(name,$sLanguagePrefArraySQL) as localname, length(name::text) as namelength ";
$sSQL .= ' from (select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, rank_search, geometry, name from placex ';
$sSQL .= ' where parent_place_id in ('.join(',', $aRelatedPlaceIDs).') and name is not null order by rank_address asc,rank_search asc limit 500) as obj';
$sSQL .= ' order by rank_address asc,rank_search asc,localname,class, type,housenumber';
$aParentOfLines = $oDB->getAll($sSQL);
if (!empty($aParentOfLines)) {
echo '<h2>Parent Of:</h2>';
$aGroupedAddressLines = array();
foreach ($aParentOfLines as $aAddressLine) {
$aAddressLine['label'] = Nominatim\ClassTypes\getLabel($aAddressLine)
?? ucwords($aAddressLine['type']);
if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array();
$aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine;
}
foreach ($aGroupedAddressLines as $sGroupHeading => $aParentOfLines) {
echo "<h3>$sGroupHeading</h3>";
foreach ($aParentOfLines as $aAddressLine) {
$aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
$sOSMType = formatOSMType($aAddressLine['osm_type'], false);
echo '<div class="line">';
echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
echo ' (';
echo '<span class="area">'.($aAddressLine['isarea']?'Polygon':'Point').'</span>';
if ($sOSMType) echo ', <span class="osm"><span class="label"></span>'.$sOSMType.' '.osmLink($aAddressLine).'</span>';
echo ', <a href="hierarchy.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
echo ', '.$aAddressLine['area'];
echo ')';
echo '</div>';
}
}
if (count($aParentOfLines) >= 500) {
echo '<p>There are more child objects which are not shown.</p>';
}
echo '</div>';
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 961 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Some files were not shown because too many files have changed in this diff Show More