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">
17 <input name="lat" type="text" class="form-control input-sm" placeholder="latitude" value="<?php echo $fLat; ?>" >
18 <a href="#" class="btn btn-default btn-xs" id="switch-coords" title="switch lat and lon"><></a>
20 <input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo $fLon; ?>" >
23 <select name="zoom" class="form-control input-sm">
24 <option value="" <?php if ($iZoom === false) echo 'selected="selected"' ?> >--</option>
28 0 => "Continent / Sea",
40 12 => "Town / Village",
52 foreach($aZoomLevels as $iZoomLevel => $sLabel)
54 $bSel = $iZoom === $iZoomLevel;
55 echo '<option value="'.$iZoomLevel.'"'.($bSel?' selected="selected"':'').'>'.$iZoomLevel.' '.$sLabel.'</option>'."\n";
60 <div class="form-group search-button-group">
61 <button type="submit" class="btn btn-primary btn-sm">Search</button>
63 <div class="search-type-link">
64 <a href="<?php echo CONST_Website_BaseURL; ?>search.php">forward search</a>
71 <?php if (count($aPlace)>0) { ?>
73 <div id="searchresults" class="sidebar">
77 echo '<div class="result" data-position="0">';
79 echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
80 echo ' <span class="name">'.htmlspecialchars($aResult['langaddress']).'</span>';
81 if (isset($aResult['label']))
82 echo ' <span class="type">('.$aResult['label'].')</span>';
83 else if ($aResult['type'] == 'yes')
84 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
86 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
87 echo '<p>'.$aResult['lat'].','.$aResult['lon'].'</p>';
88 echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
95 <div id="intro" class="sidebar">
96 Search for coordinates or click anywhere on the map.
101 <div id="map-wrapper">
102 <div id="map-position">
103 <div id="map-position-inner"></div>
104 <div id="map-position-close"><a href="#">hide</a></div>
109 </div> <!-- /content -->
117 <script type="text/javascript">
120 $aNominatimMapInit = array(
121 'zoom' => $iZoom !== false ? $iZoom : CONST_Default_Zoom,
122 'lat' => $fLat !== false ? $fLat : CONST_Default_Lat,
123 'lon' => $fLon !== false ? $fLon : CONST_Default_Lon,
124 'tile_url' => $sTileURL,
125 'tile_attribution' => $sTileAttribution
127 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
129 echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';';
132 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>