|
|
|
<!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">
|
|
|
|
var map;
|
|
|
|
var searchLayer_md = null;
|
|
|
|
var searchLayer_co = null;
|
|
|
|
var path_mdsearch = 'yacysearch_location.rss?dom=title,publisher,creator,subject&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,mdall,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.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(15,30) // Center of the map
|
|
|
|
.transform(
|
|
|
|
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
|
|
|
|
new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection
|
|
|
|
), 2 // 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();
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body id="yacysearch_location" onload="init();">
|
|
|
|
#(display)#
|
|
|
|
#%env/templates/simpleheader.template%#
|
|
|
|
::
|
|
|
|
#%env/templates/header.template%#
|
|
|
|
::
|
|
|
|
#%env/templates/embeddedheader.template%#
|
|
|
|
#(/display)#
|
|
|
|
<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="width:800px; height:600px"></div>
|
|
|
|
</body>
|
|
|
|
</html>
|