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']); ?>" >
 
  19     <div class="form-group search-button-group">
 
  20       <button type="submit" class="btn btn-primary btn-sm">Search</button>
 
  22     <div class="search-type-link">
 
  23       <a href="<?php echo CONST_Website_BaseURL; ?>search.php">forward search</a>
 
  30 <?php if ($aPlace) { ?>
 
  32     <div id="searchresults" class="sidebar">
 
  36       echo '<div class="result" data-position="0">';
 
  38       echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
 
  39       echo ' <span class="name">'.htmlspecialchars($aResult['langaddress']).'</span>';
 
  40       if (isset($aResult['label']))
 
  41         echo ' <span class="type">('.$aResult['label'].')</span>';
 
  42       else if ($aResult['type'] == 'yes')
 
  43         echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
 
  45         echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
 
  46       echo '<p>'.$aResult['lat'].','.$aResult['lon'].'</p>';
 
  47       echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
 
  54     <div id="intro" class="sidebar">
 
  55       Search for coordinates or click anywhere on the map.
 
  60     <div id="map-wrapper">
 
  61       <div id="map-position"></div>
 
  65   </div> <!-- /content -->
 
  73   <script type="text/javascript">
 
  76     $aNominatimMapInit = [
 
  77       'zoom' => (isset($_GET['lat'])||$_GET['lat'])?16:NULL,
 
  78       'lat' => isset($_GET['lat'])?htmlspecialchars($_GET['lat']):NULL,
 
  79       'lon' => isset($_GET['lon'])?htmlspecialchars($_GET['lon']):NULL
 
  81     echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
 
  83     echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';'; 
 
  86   <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>