|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<title>YaCy '#[clientname]#': Location Search</title>
|
|
|
|
#%env/templates/metas.template%#
|
|
|
|
<script type="text/javascript" src="http://openlayers.org/api/OpenLayers.js"></script>
|
|
|
|
<script type="text/javascript" src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function adaptHeight() {
|
|
|
|
document.getElementById('map').style.height = (document.documentElement.clientHeight - 130) + "px";
|
|
|
|
}
|
|
|
|
window.onresize = adaptHeight;
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var map;
|
|
|
|
var searchLayer_md = null;
|
|
|
|
var searchLayer_co = null;
|
|
|
|
var path_mdsearch = 'yacysearch_location.rss?dom=metatag&query=';
|
|
|
|
var path_cosearch = 'yacysearch_location.rss?dom=query&query=';
|
|
|
|
var marker_md = new OpenLayers.Icon("/env/grafics/marker_red.png", new OpenLayers.Size(11,16));
|
|
|
|
var marker_co = new OpenLayers.Icon("/env/grafics/star_yellow.png", new OpenLayers.Size(25,25));
|
|
|
|
// possible values for dom: query,metatag,alltext,title,publisher,creator,subject
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
map = new OpenLayers.Map('map', {
|
|
|
|
maxResolution:'auto',
|
|
|
|
controls:[
|
|
|
|
new OpenLayers.Control.Navigation(),
|
|
|
|
new OpenLayers.Control.PanZoomBar(),
|
|
|
|
new OpenLayers.Control.ZoomBox(),
|
|
|
|
new OpenLayers.Control.LayerSwitcher(),
|
|
|
|
new OpenLayers.Control.Attribution()]
|
|
|
|
});
|
|
|
|
|
|
|
|
//layerMaplint = new OpenLayers.Layer.OSM.Maplint("Maplint");
|
|
|
|
layerWMS = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
|
|
|
layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
|
|
|
|
layerOsmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender");
|
|
|
|
layerCycleMap = new OpenLayers.Layer.OSM.CycleMap("CycleMap");
|
|
|
|
map.addLayer(layerMapnik);
|
|
|
|
map.addLayer(layerOsmarender);
|
|
|
|
map.addLayer(layerCycleMap);
|
|
|
|
//map.addLayer(layerMaplint);
|
|
|
|
map.addLayer(layerWMS);
|
|
|
|
|
|
|
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
|
|
|
map.setCenter(new OpenLayers.LonLat(9,48) // Center of the map
|
|
|
|
.transform(
|
|
|
|
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
|
|
|
|
new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection
|
|
|
|
), 5 // Zoom level
|
|
|
|
);
|
|
|
|
|
|
|
|
#(initsearch)#::
|
|
|
|
var query = '#[query]#'.replace(' ', '+');
|
|
|
|
searchLayer_co = new OpenLayers.Layer.GeoRSS('GeoRSS', path_cosearch + query, {'icon':marker_co});
|
|
|
|
map.addLayer(searchLayer_co);
|
|
|
|
searchLayer_md = new OpenLayers.Layer.GeoRSS('GeoRSS', path_mdsearch + query, {'icon':marker_md});
|
|
|
|
map.addLayer(searchLayer_md);
|
|
|
|
#(/initsearch)#
|
|
|
|
}
|
|
|
|
|
|
|
|
function search() {
|
|
|
|
var query = document.getElementById('query').value.replace(' ', '+');
|
|
|
|
if (searchLayer_md != null) searchLayer_md.destroy();
|
|
|
|
if (searchLayer_co != null) searchLayer_co.destroy();
|
|
|
|
var center = map.getCenter().transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326"));
|
|
|
|
searchLayer_co = new OpenLayers.Layer.GeoRSS('GeoRSS', path_cosearch + query + '&lon=' + center.lon + '&lat=' + center.lat + '&zoom=' + map.getZoom(), {'icon':marker_co});
|
|
|
|
map.addLayer(searchLayer_co);
|
|
|
|
searchLayer_md = new OpenLayers.Layer.GeoRSS('GeoRSS', path_mdsearch + query, {'icon':marker_md});
|
|
|
|
map.addLayer(searchLayer_md);
|
|
|
|
//map.zoomToExtent(searchLayer_co.getExtent());
|
|
|
|
//map.panTo(searchLayer_co.getExtent().getCenterLonLat());
|
|
|
|
//map.setCenter(searchLayer_co.getExtent().getLonLatFromViewPortPx, 5);
|
|
|
|
//map.setCenter(searchLayer_co.getExtent().getCenterLonLat(), map.getZoomForExtent(searchLayer_co.getExtent(), true));
|
|
|
|
document.getElementById('apilink').setAttribute('href', 'yacysearch_location.rss?query=' + query);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body id="yacysearch_location" onload="init();">
|
|
|
|
#(topmenu)#
|
|
|
|
#%env/templates/embeddedheader.template%#
|
|
|
|
::
|
|
|
|
<div id="api">
|
|
|
|
<a href="yacysearch_location.rss" id="apilink"><img src="/env/grafics/api.png" width="60" height="40" alt="API"/></a>
|
|
|
|
<script type="text/javascript">
|
|
|
|
//<![CDATA[
|
|
|
|
document.getElementById('apilink').setAttribute('href', 'yacysearch_location.rss?dom=metatag|alltext&' + window.location.search.substring(1));
|
|
|
|
//]]>
|
|
|
|
</script>
|
|
|
|
<span>The information that is presented on this page can also be retrieved as XML
|
|
|
|
Click the API icon to see the XML.
|
|
|
|
To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span>
|
|
|
|
</div>
|
|
|
|
#%env/templates/simpleheader.template%#
|
|
|
|
#(/topmenu)#
|
|
|
|
|
|
|
|
<form class="search small" onsubmit="return false;" class="search small" accept-charset="UTF-8">
|
|
|
|
<h2>#[promoteSearchPageGreeting]#</h2>
|
|
|
|
<div class="yacylogo"><a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.smallImage]#" alt="yacysearch" /></a></div>
|
|
|
|
<fieldset class="yacys">
|
|
|
|
<input type="text" value="#(initsearch)#::#[query]##(/initsearch)#" id="query" size="42" />
|
|
|
|
<input type="submit" onclick="search(); return false;" value="search" onsubmit="search(); return false;" />
|
|
|
|
</fieldset>
|
|
|
|
</form><br/>
|
|
|
|
<div id="map" style="clear:both; width:100%; height:720px"></div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
adaptHeight();
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|