X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/bfe51197429c9436034bb4d25931ad4d687d09c8..cc3e4aa532559b5c8948152fb6d4ab68da22fe28:/lib/template/details-html.php diff --git a/lib/template/details-html.php b/lib/template/details-html.php index c438659b..f20ec619 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -53,42 +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]); + } } - @@ -114,6 +111,11 @@ if (isset($aPolyPoints)) 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) { @@ -141,7 +143,7 @@ if (isset($aPolyPoints)) echo 'Type: '.$aAddressLine['class'].':'.$aAddressLine['type'].''; if ($sOSMType) echo ', '.$sOSMType.' '.$aAddressLine['osm_id'].''; echo ', '.$aAddressLine['admin_level'].''; - echo ', '.$aAddressLine['rank_search_label'].''; + if (isset($aAddressLine['rank_search_label'])) echo ', '.$aAddressLine['rank_search_label'].''; // echo ', '.($aAddressLine['fromarea']=='t'?'Polygon':'Point').''; echo ', '.$aAddressLine['distance'].''; echo ' GOTO'; @@ -194,7 +196,7 @@ if (isset($aPolyPoints)) if (sizeof($aParentOfLines)) { - echo '

Parent Of (named features only):

'; + echo '

Parent Of:

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

There are more child objects which are not shown.

'; + } echo ''; }