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/details.css" rel="stylesheet" type="text/css" />
12 function osm_link($aFeature)
14 $sOSMType = ($aFeature['osm_type'] == 'N'?'node':($aFeature['osm_type'] == 'W'?'way':($aFeature['osm_type'] == 'R'?'relation':'')));
16 return '<a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aFeature['osm_id'].'">'.$sOSMType.' '.$aFeature['osm_id'].'</a>';
21 function osm_map_url($aFeature)
23 $sLon = $aFeature['error_x'];
24 $sLat = $aFeature['error_y'];
28 $sOSMType = ($aFeature['osm_type'] == 'N'?'node':($aFeature['osm_type'] == 'W'?'way':($aFeature['osm_type'] == 'R'?'relation':'')));
31 return "http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$aFeature['osm_id'];
37 function josm_edit_url($aFeature)
40 $sLon = $aFeature['error_x'];
41 $sLat = $aFeature['error_y'];
45 return "http://localhost:8111/load_and_zoom?left=".($sLon-$fWidth)."&right=".($sLon+$fWidth)."&top=".($sLat+$fWidth)."&bottom=".($sLat-$fWidth);
48 $sOSMType = ($aFeature['osm_type'] == 'N'?'node':($aFeature['osm_type'] == 'W'?'way':($aFeature['osm_type'] == 'R'?'relation':'')));
51 return 'http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/'.$sOSMType.'/'.$aFeature['osm_id'].'/full';
52 // Should be better to load by object id - but this doesn't seem to zoom correctly
53 // return " <a href=\"http://localhost:8111/load_object?new_layer=true&objects=".strtolower($aFeature['osm_type']).$sOSMID."\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
58 function potlach_edit_url($aFeature)
61 $sLat = $aFeature['error_y'];
62 $sLon = $aFeature['error_x'];
66 return "http://www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth);
75 <body id="details-page">
76 <div class="container">
78 <div class="col-md-6">
81 <h1><?php echo $aPointDetails['localname'] ?></h1>
82 <div class="locationdetails">
83 <h2 class="bg-danger">This object has an invalid geometry.</h2>
86 Type: <span class="type"><?php echo $aPointDetails['class'].':'.$aPointDetails['type'];?></span>
90 OSM: <span class="label"><?php echo osm_link($aPointDetails); ?><span>
96 <?php echo $aPointDetails['errormessage']?$aPointDetails['errormessage']:'unknown'; ?>
98 <?php if (osm_map_url($aPointDetails)) { ?>
99 <a href="<?php echo osm_map_url($aPointDetails); ?>">view on osm.org</a>
104 <?php if (josm_edit_url($aPointDetails)) { ?>
105 <li><a href="<?php echo josm_edit_url($aPointDetails); ?>" target="josm">Remote Control (JOSM / Merkaartor)</a></li>
107 <?php if (potlach_edit_url($aPointDetails)) { ?>
108 <li><a href="<?php echo potlach_edit_url($aPointDetails); ?>" target="potlatch2">Potlatch 2</a></li>
113 <div class="col-md-6">
120 <script type="text/javascript">
122 var nominatim_result = {
123 outlinestring: '<?php echo $aPointDetails['outlinestring'];?>',
124 lon: <?php echo isset($aPointDetails['error_x']) ? $aPointDetails['error_x'] : 0; ?>,
125 lat: <?php echo isset($aPointDetails['error_y']) ? $aPointDetails['error_y'] : 0; ?>
131 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>