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 $fLat; ?>" >
 
  17             <span id="switch-coords"><></span>
 
  18             <input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo $fLon; ?>" >
 
  21             <select name="zoom" class="form-control input-sm">
 
  22                 <option value="" <?php if ($iZoom === false) echo 'selected="selected"' ?> >--</option>
 
  26                          0 => "Continent / Sea",
 
  38                         12 => "Town / Village",
 
  50                     foreach($aZoomLevels as $iZoomLevel => $sLabel)
 
  52                         $bSel = $iZoom === $iZoomLevel;
 
  53                         echo '<option value="'.$iZoomLevel.'"'.($bSel?' selected="selected"':'').'>'.$iZoomLevel.' '.$sLabel.'</option>'."\n";
 
  58         <div class="form-group search-button-group">
 
  59             <button type="submit" class="btn btn-primary btn-sm">Search</button>
 
  61         <div class="search-type-link">
 
  62             <a href="<?php echo CONST_Website_BaseURL; ?>search.php">forward search</a>
 
  69 <?php if (count($aPlace)>0) { ?>
 
  71         <div id="searchresults" class="sidebar">
 
  75             echo '<div class="result" data-position="0">';
 
  77             echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
 
  78             echo ' <span class="name">'.htmlspecialchars($aResult['langaddress']).'</span>';
 
  79             if (isset($aResult['label']))
 
  80                 echo ' <span class="type">('.$aResult['label'].')</span>';
 
  81             else if ($aResult['type'] == 'yes')
 
  82                 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
 
  84                 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
 
  85             echo '<p>'.$aResult['lat'].','.$aResult['lon'].'</p>';
 
  86             echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
 
  93         <div id="intro" class="sidebar">
 
  94             Search for coordinates or click anywhere on the map.
 
  99         <div id="map-wrapper">
 
 100             <div id="map-position">
 
 101                 <div id="map-position-inner"></div>
 
 102                 <div id="map-position-close"><a href="#">hide</a></div>
 
 107     </div> <!-- /content -->
 
 115     <script type="text/javascript">
 
 118         $aNominatimMapInit = array(
 
 119             'zoom' => $iZoom !== false ? $iZoom : CONST_Default_Zoom,
 
 120             'lat'  => $fLat !== false ? $fLat : CONST_Default_Lat,
 
 121             'lon'  => $fLon !== false ? $fLon : CONST_Default_Lon,
 
 122             'tile_url' => $sTileURL,
 
 123             'tile_attribution' => $sTileAttribution
 
 125         echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
 
 127         echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';'; 
 
 130     <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>