]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/details-error-html.php
Merge branch 'master' of github.com:twain47/Nominatim
[nominatim.git] / lib / template / details-error-html.php
index ee23e661335e84bab38779b7b3e2eb14ddffbb41..1268414d8f6de04d2dd2987a59cd0bc08f94b7da 100644 (file)
@@ -1,7 +1,8 @@
 <?php
        header("content-type: text/html; charset=UTF-8");
 ?>
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <title>OpenStreetMap Nominatim: <?php echo $aPointDetails['localname'];?></title>
     <style>
@@ -53,8 +54,7 @@ body {
                 projection: new OpenLayers.Projection("EPSG:900913"),
                 displayProjection: new OpenLayers.Projection("EPSG:4326")
                } );
-                       map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default",
-                        { attribution : '© <a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a> and contributors, under an <a target="_parent" href="http://www.openstreetmap.org/copyright">open license</a>'}));
+                       map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default"));
 
                         var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
                         layer_style.fillOpacity = 0.2;
@@ -142,7 +142,39 @@ body {
 ?>
 
     <p>This object has an invalid geometry.</p>
-    <p><b>Details:</b> <?php echo $aPointDetails['errormessage'];?></p>
+    <p><b>Details:</b> <?php
+
+$sVal = $aPointDetails['errormessage']?$aPointDetails['errormessage']:'&nbsp;';
+$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
+$sOSMID = $aPointDetails['osm_id'];
+
+if (isset($aPointDetails['error_x']))
+{
+       $sLat = $aPointDetails['error_y'];
+       $sLon = $aPointDetails['error_x'];
+       echo "<a href=\"http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$sOSMID."\">".$sVal."</a>";
+}
+else
+{
+       echo $sVal;
+}
+?>
+    <p><b>Edit:</b> in <?php
+if (isset($aPointDetails['error_x']))
+{
+       $fWidth = 0.0002;
+       echo " <a href=\"http://localhost:8111/load_and_zoom?left=".($sLon-$fWidth)."&right=".($sLon+$fWidth)."&top=".($sLat+$fWidth)."&bottom=".($sLat-$fWidth)."\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
+       echo " | <a href=\"http://www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth)."\" target=\"potlatch2\">Potlatch 2</a>";
+}
+else
+{
+       echo " <a href=\"http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/".$sOSMType.'/'.$sOSMID."/full\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
+       // Should be better to load by object id - but this doesn't seem to zoom correctly
+       //echo " <a href=\"http://localhost:8111/load_object?new_layer=true&objects=".strtolower($aPointDetails['osm_type']).$sOSMID."\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
+}
+
+?></p>
 
   </body>
 </html>
+