2 header("content-type: text/html; charset=UTF-8");
4 <?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
5 <link href="css/common.css" rel="stylesheet" type="text/css" />
6 <link href="css/search.css" rel="stylesheet" type="text/css" />
9 <body id="reverse-page">
11 <?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
13 <form class="form-inline" role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>reverse.php">
14 <div class="form-group">
15 <input name="format" type="hidden" value="html">
16 <input name="prevmapzoom" type="hidden" value="">
17 <input name="lat" type="text" class="form-control input-sm" placeholder="latitude" value="<?php echo htmlspecialchars($_GET['lat']); ?>" >
18 <input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo htmlspecialchars($_GET['lon']); ?>" >
20 <div class="form-group search-button-group">
21 <button type="submit" class="btn btn-primary btn-sm">Search</button>
23 <div class="search-type-link">
24 <a href="<?php echo CONST_Website_BaseURL; ?>search.php">forward search</a>
31 <?php if ($aPlace) { ?>
33 <div id="searchresults" class="sidebar">
37 echo '<div class="result" data-position="0">';
39 echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
40 echo ' <span class="name">'.htmlspecialchars($aResult['langaddress']).'</span>';
41 if (isset($aResult['label']))
42 echo ' <span class="type">('.$aResult['label'].')</span>';
43 else if ($aResult['type'] == 'yes')
44 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
46 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
47 echo '<p>'.$aResult['lat'].','.$aResult['lon'].'</p>';
48 echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
55 <div id="intro" class="sidebar">
56 Search for coordinates or click anywhere on the map.
61 <div id="map-wrapper">
62 <div id="map-position"></div>
66 </div> <!-- /content -->
74 <script type="text/javascript">
77 $aNominatimMapInit = [
78 'prevmapzoom' => isset($_GET['prevmapzoom'])?htmlspecialchars($_GET['prevmapzoom']):NULL,
79 'zoom' => isset($_GET['zoom'])?htmlspecialchars($_GET['zoom']):NULL,
80 'lat' => isset($_GET['lat'] )?htmlspecialchars($_GET['lat']):NULL,
81 'lon' => isset($_GET['lon'] )?htmlspecialchars($_GET['lon']):NULL
83 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
85 echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';';
88 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>