X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c9d51fe7b8c915e898d95af57dc2c013b9cf84a0..cc3e4aa532559b5c8948152fb6d4ab68da22fe28:/lib/template/details-html.php diff --git a/lib/template/details-html.php b/lib/template/details-html.php index eca76c7e..f20ec619 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -53,39 +53,39 @@ body { projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326") } ); - map.addLayer(new OpenLayers.Layer.OSM.("Default")); + map.addLayer(new OpenLayers.Layer.OSM.("Default", + { attribution : '© OpenStreetMap and contributors, under an open license'})); - var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']); - layer_style.fillOpacity = 0.2; - layer_style.graphicOpacity = 0.2; + var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']); + layer_style.fillOpacity = 0.2; + layer_style.graphicOpacity = 0.2; vectorLayer = new OpenLayers.Layer.Vector("Points", {style: layer_style}); map.addLayer(vectorLayer); - var pointList = []; - var style = { - strokeColor: "#75ADFF", - fillColor: "#F0F7FF", - strokeWidth: 2, - strokeOpacity: 0.75, - fillOpacity: 0.75 - }; var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326"); var proj_map = map.getProjectionObject(); - var latlon; - - var linearRing = new OpenLayers.Geometry.LinearRing(pointList).transform(proj_EPSG4326, proj_map);; - var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,style); - vectorLayer.addFeatures([polygonFeature]); - map.zoomToExtent(new OpenLayers.Bounds(, , , ).transform(proj_EPSG4326, proj_map)); + freader = new OpenLayers.Format.WKT({ + 'internalProjection': proj_map, + 'externalProjection': proj_EPSG4326 + }); + + var feature = freader.read(''); + if (feature) { + map.zoomToExtent(feature.geometry.getBounds()); + + feature.style = { + strokeColor: "#75ADFF", + fillColor: "#F0F7FF", + strokeWidth: , + strokeOpacity: 0.75, + fillOpacity: 0.75, + pointRadius: 100 + }; + vectorLayer.addFeatures([feature]); + } } - @@ -111,6 +111,11 @@ foreach($aPolyPoints as $aPolyPoint) echo '
Coverage: '.($aPointDetails['isarea']=='t'?'Polygon':'Point').'
'; $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':''))); if ($sOSMType) echo '
OSM: '.$sOSMType.' '.$aPointDetails['osm_id'].'
'; + if ($aPointDetails['wikipedia']) + { + list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aPointDetails['wikipedia']); + echo '
Wikipedia Calculated: '.$aPointDetails['wikipedia'].'
'; + } echo '
Extra Tags: '; foreach($aPointDetails['aExtraTags'] as $sKey => $sValue) { @@ -138,8 +143,8 @@ foreach($aPolyPoints as $aPolyPoint) echo 'Type: '.$aAddressLine['class'].':'.$aAddressLine['type'].''; if ($sOSMType) echo ', '.$sOSMType.' '.$aAddressLine['osm_id'].''; echo ', '.$aAddressLine['admin_level'].''; - echo ', '.$aAddressLine['rank_search_label'].''; - echo ', '.($aAddressLine['fromarea']=='t'?'Polygon':'Point').''; + if (isset($aAddressLine['rank_search_label'])) echo ', '.$aAddressLine['rank_search_label'].''; +// echo ', '.($aAddressLine['fromarea']=='t'?'Polygon':'Point').''; echo ', '.$aAddressLine['distance'].''; echo ' GOTO'; echo ')'; @@ -147,6 +152,30 @@ foreach($aPolyPoints as $aPolyPoint) } echo '
'; + if ($aLinkedLines) + { + echo '

Linked Places

'; + echo '
'; + foreach($aLinkedLines as $aAddressLine) + { + $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':''))); + + echo '
'; + echo ''.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name').''; + echo ' ('; + echo 'Type: '.$aAddressLine['class'].':'.$aAddressLine['type'].''; + if ($sOSMType) echo ', '.$sOSMType.' '.$aAddressLine['osm_id'].''; + echo ', '.$aAddressLine['admin_level'].''; + echo ', '.$aAddressLine['rank_search_label'].''; +// echo ', '.($aAddressLine['fromarea']=='t'?'Polygon':'Point').''; + echo ', '.$aAddressLine['distance'].''; + echo ' GOTO'; + echo ')'; + echo '
'; + } + echo '
'; + } + if ($aPlaceSearchNameKeywords) { echo '

Name Keywords

'; @@ -167,7 +196,7 @@ foreach($aPolyPoints as $aPolyPoint) if (sizeof($aParentOfLines)) { - echo '

Parent Of (named features only):

'; + echo '

Parent Of:

'; $aGroupedAddressLines = array(); foreach($aParentOfLines as $aAddressLine) @@ -198,6 +227,9 @@ foreach($aPolyPoints as $aPolyPoint) echo ''; } } + if (sizeof($aParentOfLines) >= 500) { + echo '

There are more child objects which are not shown.

'; + } echo ''; }