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="lat" type="text" class="form-control input-sm" placeholder="latitude" value="<?php echo htmlspecialchars($_GET['lat']); ?>" >
17 <input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo htmlspecialchars($_GET['lon']); ?>" >
20 <select name="zoom" class="form-control input-sm" value="<?php echo htmlspecialchars($_GET['zoom']); ?>">
21 <option value="" <?php echo $_GET['zoom']==''?'selected':'' ?> >--</option>
25 0 => "Continent / Sea",
37 12 => "Town / Village",
49 foreach($aZoomLevels as $iZoomLevel => $sLabel)
51 $bSel = isset($_GET['zoom']) && ($_GET['zoom'] == (string)$iZoomLevel);
52 echo '<option value="'.$iZoomLevel.'"'.($bSel?'selected':'').'>'.$iZoomLevel.' '.$sLabel.'</option>'."\n";
57 <div class="form-group search-button-group">
58 <button type="submit" class="btn btn-primary btn-sm">Search</button>
60 <div class="search-type-link">
61 <a href="<?php echo CONST_Website_BaseURL; ?>search.php">forward search</a>
68 <?php if ($aPlace) { ?>
70 <div id="searchresults" class="sidebar">
74 echo '<div class="result" data-position="0">';
76 echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
77 echo ' <span class="name">'.htmlspecialchars($aResult['langaddress']).'</span>';
78 if (isset($aResult['label']))
79 echo ' <span class="type">('.$aResult['label'].')</span>';
80 else if ($aResult['type'] == 'yes')
81 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
83 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
84 echo '<p>'.$aResult['lat'].','.$aResult['lon'].'</p>';
85 echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
92 <div id="intro" class="sidebar">
93 Search for coordinates or click anywhere on the map.
98 <div id="map-wrapper">
99 <div id="map-position"></div>
103 </div> <!-- /content -->
111 <script type="text/javascript">
114 $aNominatimMapInit = array(
115 'zoom' => isset($_GET['zoom']) ? htmlspecialchars($_GET['zoom']) : CONST_Default_Zoom,
116 'lat' => isset($_GET['lat']) ? htmlspecialchars($_GET['lat']) : CONST_Default_Lat,
117 'lon' => isset($_GET['lon']) ? htmlspecialchars($_GET['lon']) : CONST_Default_Lon,
118 'tile_url' => $sTileURL,
119 'tile_attribution' => $sTileAttribution
121 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
123 echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';';
126 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>