2 header("content-type: text/html; charset=UTF-8");
6 <title>OpenStreetMap Nominatim: <?php echo $aPointDetails['localname'];?></title>
13 font: normal 12px/15px arial,sans-serif;
30 border: 2px solid #666;
34 <script src="js/OpenLayers.js"></script>
35 <script src="js/tiles.js"></script>
36 <script type="text/javascript">
41 map = new OpenLayers.Map ("map", {
43 new OpenLayers.Control.Permalink(),
44 new OpenLayers.Control.Navigation(),
45 new OpenLayers.Control.PanZoomBar(),
46 new OpenLayers.Control.MouseDefaults(),
47 new OpenLayers.Control.MousePosition(),
48 new OpenLayers.Control.Attribution()],
49 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
50 maxResolution: 156543.0399,
53 projection: new OpenLayers.Projection("EPSG:900913"),
54 displayProjection: new OpenLayers.Projection("EPSG:4326")
56 map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default",
57 { 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>'}));
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'];
148 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
149 $sOSMID = $aPointDetails['osm_id'];
151 $bHaveLatLng = false;
152 if (preg_match('/Self-intersection\\[([0-9.\\-]+) ([0-9.\\-]+)\\]/',$sVal,$aMatch))
157 echo "<a href=\"http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$sOSMID."\">".($sVal?$sVal:' ')."</a>";
161 echo ($sVal?$sVal:' ');
164 <p><b>Edit:</b> in <?php
168 echo " <a href=\"http://localhost:8111/load_and_zoom?left=".($sLon-$fWidth)."&right=".($sLon+$fWidth)."&top=".($sLat+$fWidth)."&bottom=".($sLat-$fWidth)."\" target=\"josm\">Remote Controll (JOSM / Merkaartor)</a>";
169 echo " | <a href=\"http://www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth)."\" target=\"potlatch2\">Potlatch 2</a>";
173 echo " <a href=\"http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/".$sOSMType.'/'.$sOSMID."/full\" target=\"josm\">Remote Controll (JOSM / Merkaartor)</a>";
174 // Should be better to load by object id - but this doesn't seem to zoom correctly
175 //echo " <a href=\"http://localhost:8111/load_object?new_layer=true&objects=".strtolower($aPointDetails['osm_type']).$sOSMID."\" target=\"josm\">Remote Controll (JOSM / Merkaartor)</a>";