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 'There are more child objects which are not shown.
'; + } echo ''; }