X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/620100a5ac943e86e54f81f40dc52f1dd0d61330..1d4dcd914fd277aebf242037064612224f4dde54:/lib/template/details-error-html.php diff --git a/lib/template/details-error-html.php b/lib/template/details-error-html.php index 1c6d2a0a..bc00f84d 100644 --- a/lib/template/details-error-html.php +++ b/lib/template/details-error-html.php @@ -9,27 +9,18 @@ '.$sOSMType.' '.$aFeature['osm_id'].''; - } - return ''; - } - - function osm_map_url($aFeature) - { - $sLon = $aFeature['error_x']; - $sLat = $aFeature['error_y']; - - if (isset($sLat)) + if (isset($sFeature['error_x']) && isset($sFeature['error_y'])) { - $sOSMType = ($aFeature['osm_type'] == 'N'?'node':($aFeature['osm_type'] == 'W'?'way':($aFeature['osm_type'] == 'R'?'relation':''))); + $sBaseUrl = '//www.openstreetmap.org/'; + $sOSMType = formatOSMType($aFeature['osm_type'], false); if ($sOSMType) { - return "http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$aFeature['osm_id']; + $sBaseUrl += $sOSMType.'/'.$aFeature['osm_id']; } + + return 'view on osm.org'; } return ''; } @@ -45,7 +36,7 @@ return "http://localhost:8111/load_and_zoom?left=".($sLon-$fWidth)."&right=".($sLon+$fWidth)."&top=".($sLat+$fWidth)."&bottom=".($sLat-$fWidth); } - $sOSMType = ($aFeature['osm_type'] == 'N'?'node':($aFeature['osm_type'] == 'W'?'way':($aFeature['osm_type'] == 'R'?'relation':''))); + $sOSMType = formatOSMType($aFeature['osm_type'], false); if ($sOSMType) { return 'http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/'.$sOSMType.'/'.$aFeature['osm_id'].'/full'; @@ -63,7 +54,7 @@ if (isset($sLat)) { - return "http://www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth); + return "//www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth); } return ''; } @@ -87,7 +78,7 @@
- - view on osm.org - +