responsive details-error page. Shared header and footer

This commit is contained in:
Marc Tobias Metten
2016-01-19 12:29:07 +01:00
parent 97c572b92f
commit f2a2c29815
12 changed files with 279 additions and 306 deletions

31
website/css/common.css Normal file
View File

@@ -0,0 +1,31 @@
header {
width: 100%;
padding: 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;
}

View File

@@ -1,7 +1,3 @@
body {
margin-top: 1em;
font-size: 1.2em;
}
h1 {
margin: 30px 0;
}
@@ -13,8 +9,7 @@ h3 {
font-size: 1.5em;
}
.table {
/*width: auto;*/
max-width: 800px;
width: 100%;
}
.name{
font-weight: bold;

View File

@@ -1,34 +1,3 @@
header {
width: 100%;
padding: 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;
}
form {
@@ -47,7 +16,7 @@ form label {
.sidebar {
width: 25%;
padding: 10px;
padding: 15px;
padding-top: 0;
display: inline-block;
float: left;

View File

@@ -25,6 +25,7 @@
$_GET['place_id'] = $oDB->getOne("select place_id from placex where osm_type = '".$_GET['osmtype']."' and osm_id = ".(int)$_GET['osmid']." order by type = 'postcode' asc");
// Be nice about our error messages for broken geometry
if (!$_GET['place_id'])
{
$aPointDetails = $oDB->getRow("select osm_type, osm_id, errormessage, class, type, get_name_by_language(name,$sLanguagePrefArraySQL) as localname, ST_AsText(prevgeometry) as prevgeom, ST_AsText(newgeometry) as newgeom from import_polygon_error where osm_type = '".$_GET['osmtype']."' and osm_id = ".(int)$_GET['osmid']." order by updated desc limit 1");
@@ -34,12 +35,18 @@
$aPointDetails['error_x'] = $aMatches[1];
$aPointDetails['error_y'] = $aMatches[2];
}
else
{
$aPointDetails['error_x'] = 0;
$aPointDetails['error_y'] = 0;
}
include(CONST_BasePath.'/lib/template/details-error-'.$sOutputFormat.'.php');
exit;
}
}
}
if (!isset($_GET['place_id']))
{
echo "Please select a place id";
@@ -90,7 +97,7 @@
$aAddressLines = getAddressDetails($oDB, $sLanguagePrefArraySQL, $iPlaceID, $aPointDetails['country_code'], true);
// Linked places
$sSQL = "select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, st_distance(geometry, placegeometry) as distance, ";
$sSQL = "select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, ST_Distance_Spheroid(geometry, placegeometry, 'SPHEROID[\"WGS 84\",6378137,298.257223563, AUTHORITY[\"EPSG\",\"7030\"]]') as distance, ";
$sSQL .= " get_name_by_language(name,$sLanguagePrefArraySQL) as localname, length(name::text) as namelength ";
$sSQL .= " from placex, (select geometry as placegeometry from placex where place_id = $iPlaceID) as x";
$sSQL .= " where linked_place_id = $iPlaceID";
@@ -98,7 +105,7 @@
$aLinkedLines = $oDB->getAll($sSQL);
// All places this is an imediate parent of
$sSQL = "select obj.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, st_distance(geometry, placegeometry) as distance, ";
$sSQL = "select obj.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, ST_Distance_Spheroid(geometry, placegeometry, 'SPHEROID[\"WGS 84\",6378137,298.257223563, AUTHORITY[\"EPSG\",\"7030\"]]') as distance, ";
$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 = $iPlaceID order by rank_address asc,rank_search asc limit 500) as obj,";

View File

@@ -165,14 +165,18 @@ jQuery(document).on('ready', function(){
var layerGroup = new L.layerGroup().addTo(map);
var outline = omnivore.wkt.parse(nominatim_result.outlinestring);
map.addLayer(outline);
var circle = L.circleMarker([nominatim_result.lat,nominatim_result.lon], { radius: 10, weight: 2, fillColor: '#ff7800', color: 'blue', opacity: 0.75});
map.addLayer(circle);
map.fitBounds(outline.getBounds());
if ( nominatim_result.outlinestring ){
var outline = omnivore.wkt.parse(nominatim_result.outlinestring);
map.addLayer(outline);
map.fitBounds(outline.getBounds());
} else {
map.setView([nominatim_result.lat,nominatim_result.lon],10);
}
});

View File

@@ -48,11 +48,11 @@
$bAsSVG = (boolean)isset($_GET['polygon_svg']) && $_GET['polygon_svg'];
$bAsText = (boolean)isset($_GET['polygon_text']) && $_GET['polygon_text'];
if ( ( ($bAsGeoJSON?1:0)
+ ($bAsKML?1:0)
+ ($bAsSVG?1:0)
+ ($bAsText?1:0)
+ ($bAsPoints?1:0)
) > CONST_PolygonOutput_MaximumTypes)
+ ($bAsKML?1:0)
+ ($bAsSVG?1:0)
+ ($bAsText?1:0)
+ ($bAsPoints?1:0)
) > CONST_PolygonOutput_MaximumTypes)
{
if (CONST_PolygonOutput_MaximumTypes)
{
@@ -92,23 +92,24 @@
}
include(CONST_BasePath.'/lib/template/search-batch-json.php');
exit;
} else {
if (!(isset($_GET['q']) && $_GET['q']) && isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'][0] == '/')
{
$sQuery = substr(rawurldecode($_SERVER['PATH_INFO']), 1);
}
else
{
if (!(isset($_GET['q']) && $_GET['q']) && isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'][0] == '/')
{
$sQuery = substr(rawurldecode($_SERVER['PATH_INFO']), 1);
// reverse order of '/' separated string
$aPhrases = explode('/', $sQuery);
$aPhrases = array_reverse($aPhrases);
$sQuery = join(', ',$aPhrases);
$oGeocode->setQuery($sQuery);
}
else
{
$oGeocode->setQueryFromParams($_GET);
}
}
// reverse order of '/' separated string
$aPhrases = explode('/', $sQuery);
$aPhrases = array_reverse($aPhrases);
$sQuery = join(', ',$aPhrases);
$oGeocode->setQuery($sQuery);
}
else
{
$oGeocode->setQueryFromParams($_GET);
}
}
$hLog = logStart($oDB, 'search', $oGeocode->getQueryString(), $aLangPrefOrder);