2         header("content-type: text/html; charset=UTF-8");
 
   4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
   5 <html xmlns="http://www.w3.org/1999/xhtml">
 
   7     <title>OpenStreetMap Nominatim: <?php echo $aPointDetails['localname'];?></title>
 
  14   font: normal 12px/15px arial,sans-serif;
 
  31   border: 2px solid #666;
 
  35         <script src="js/OpenLayers.js"></script>
 
  36         <script src="js/tiles.js"></script>
 
  37         <script type="text/javascript">
 
  42                         map = new OpenLayers.Map ("map", {
 
  44                                                                                 new OpenLayers.Control.Permalink(),
 
  45                                                                                 new OpenLayers.Control.Navigation(),
 
  46                                                                                 new OpenLayers.Control.PanZoomBar(),
 
  47                                                                                 new OpenLayers.Control.MouseDefaults(),
 
  48                                                                                 new OpenLayers.Control.MousePosition(),
 
  49                                                                                 new OpenLayers.Control.Attribution()],
 
  50                 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
 
  51                 maxResolution: 156543.0399,
 
  54                 projection: new OpenLayers.Projection("EPSG:900913"),
 
  55                 displayProjection: new OpenLayers.Projection("EPSG:4326")
 
  57                         map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default"));
 
  59                         var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
 
  60                         layer_style.fillOpacity = 0.2;
 
  61                         layer_style.graphicOpacity = 0.2;
 
  63                         vectorLayer = new OpenLayers.Layer.Vector("Points", {style: layer_style});
 
  64                         map.addLayer(vectorLayer);
 
  66             var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
 
  67                         var proj_map = map.getProjectionObject();
 
  69             freader = new OpenLayers.Format.WKT({
 
  70                 'internalProjection': proj_map,
 
  71                 'externalProjection': proj_EPSG4326
 
  75             <?php if ($aPointDetails['prevgeom']) { ?>
 
  76             var feature = freader.read('<?php echo $aPointDetails['prevgeom'];?>');
 
  78                 bounds = feature.geometry.getBounds();
 
  82                                 strokeColor: "#777777",
 
  87                 strokeDashstyle: "longdash"
 
  89             vectorLayer.addFeatures([feature]);
 
  92             <?php if ($aPointDetails['newgeom']) { ?>
 
  93             feature = freader.read('<?php echo $aPointDetails['newgeom'];?>');
 
  96                     bounds = feature.geometry.getBounds();
 
 100                     bounds.extend(feature.geometry.getBounds());
 
 104                                 strokeColor: "#75ADFF",
 
 105                                 fillColor: "#FFF7F0",
 
 110             vectorLayer.addFeatures([feature]);
 
 113             <?php if (isset($aPointDetails['error_x'])) { ?>
 
 114             var pt = new OpenLayers.Geometry.Point(<?php echo $aPointDetails['error_x'].','.$aPointDetails['error_y'];?>);
 
 115             pt = pt.transform(proj_EPSG4326, proj_map);
 
 116             feature = new OpenLayers.Feature.Vector(pt, null,
 
 119                             fillColor: "#FF0000",
 
 123             vectorLayer.addFeatures([feature]);
 
 127             map.zoomToExtent(bounds);
 
 133   <body onload="init();">
 
 135         <h1><?php echo $aPointDetails['localname'] ?></h1>
 
 136         <div class="locationdetails">
 
 137         <div>Type: <span class="type"><?php echo $aPointDetails['class'].':'.$aPointDetails['type'];?></span></div>
 
 140     $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':   ($aPointDetails['osm_type'] == 'R'?'relation':'')));
 
 141     if ($sOSMType) echo ' <div>OSM: <span class="osm"><span class="label"></span>'.$sOSMType.' <a     href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aPointDetails['osm_id'].'">'.              $aPointDetails['osm_id'].'</a></span></div>';
 
 144     <p>This object has an invalid geometry.</p>
 
 145     <p><b>Details:</b> <?php
 
 147 $sVal = $aPointDetails['errormessage']?$aPointDetails['errormessage']:' ';
 
 148 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
 
 149 $sOSMID = $aPointDetails['osm_id'];
 
 151 if (isset($aPointDetails['error_x']))
 
 153         $sLat = $aPointDetails['error_y'];
 
 154         $sLon = $aPointDetails['error_x'];
 
 155         echo "<a href=\"http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$sOSMID."\">".$sVal."</a>";
 
 162     <p><b>Edit:</b> in <?php
 
 163 if (isset($aPointDetails['error_x']))
 
 166         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>";
 
 167         echo " | <a href=\"http://www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth)."\" target=\"potlatch2\">Potlatch 2</a>";
 
 171         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>";
 
 172         // Should be better to load by object id - but this doesn't seem to zoom correctly
 
 173         //echo " <a href=\"http://localhost:8111/load_object?new_layer=true&objects=".strtolower($aPointDetails['osm_type']).$sOSMID."\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";