- added more map layers to the new location search: openstreetmap (mapnik, osmarender, cycle map)

- cycle map is default because it looks best at 'world view'
- added control elements to map
- increased map size
- added deletion of search results for each time when a new search is done
- moved search box up and added yacy icon in such a way that the search page looks exaclty the same as the standard search

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6885 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent bd0a9df895
commit 227ebc6651

@ -18,8 +18,6 @@
#%env/templates/simpleheader.template%#
<script src="/yacy/ui/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/yacy/ui/js/jquery-ui-1.7.2.min.js" type="text/javascript"></script>
<link media="screen" type="text/css" href="/yacy/ui/css/themes/start/ui.base.css" rel="stylesheet" />
<link media="screen" type="text/css" href="/yacy/ui/css/themes/start/ui.theme.css" rel="stylesheet" />
::
<div id="api">
<script type="text/javascript">
@ -38,8 +36,6 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
#%env/templates/embeddedheader.template%#
<script src="/yacy/ui/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/yacy/ui/js/jquery-ui-1.7.2.min.js" type="text/javascript"></script>
<link media="screen" type="text/css" href="/yacy/ui/css/themes/start/ui.base.css" rel="stylesheet" />
<link media="screen" type="text/css" href="/yacy/ui/css/themes/start/ui.theme.css" rel="stylesheet" />
#(/display)#
<script type="text/javascript">
@ -64,41 +60,40 @@ $(function() {
</script>
<form class="search small" action="yacysearch.html" method="get" 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 id="search" name="query" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="Enter" type="submit" name="Enter" value="Search" />
#(searchdomswitches)#::
<div class="yacysearch">
#(searchtext)#::<input type="radio" id="text" name="contentdom" value="text" #(check)#::checked="checked"#(/check)# /><label for="text">Text</label>&nbsp;&nbsp;#(/searchtext)#
#(searchimage)#::<input type="radio" id="image" name="contentdom" value="image" #(check)#::checked="checked"#(/check)# /><label for="image">Images</label>&nbsp;&nbsp;#(/searchimage)#
#(searchaudio)#::<input type="radio" id="audio" name="contentdom" value="audio" #(check)#::checked="checked"#(/check)# /><label for="audio">Audio</label>&nbsp;&nbsp;#(/searchaudio)#
#(searchvideo)#::<input type="radio" id="video" name="contentdom" value="video" #(check)#::checked="checked"#(/check)# /><label for="video">Video</label>&nbsp;&nbsp;#(/searchvideo)#
#(searchapp)#::<input type="radio" id="app" name="contentdom" value="app" #(check)#::checked="checked"#(/check)# /><label for="app">Applications</label>#(/searchapp)#
&nbsp;
<a href="index.html?display=#[display]#&amp;searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#&amp;meanCount=#[meanCount]#">more options</a>
</div>
#(/searchdomswitches)#
<input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="maximumRecords" value="#[count]#" />
<input type="hidden" name="startRecord" value="#[offset]#" />
<input type="hidden" name="verify" value="#[verify]#" />
<input type="hidden" name="resource" value="#[resource]#" />
<input type="hidden" name="nav" value="all" />
<input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#" />
<input type="hidden" name="prefermaskfilter" value="#[prefermaskfilter]#" />
<input type="hidden" name="depth" value="#[depth]#" />
<input type="hidden" name="cat" value="#[cat]#" />
<input type="hidden" name="display" value="#[display]#" />
<input type="hidden" name="constraint" value="#[constraint]#" />
<input type="hidden" name="meanCount" value="#[meanCount]#" />
</fieldset>
</form>
#(didYouMean)#
::
<p><b>Did you mean:</b> #{suggestions}# <a href="#[url]#">#[word]#</a> #[sep]##{/suggestions}#</p>
#(/didYouMean)#
<h2>#[promoteSearchPageGreeting]#</h2>
<div class="yacylogo"><a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.smallImage]#" alt="yacysearch" /></a></div>
<fieldset class="yacys">
<input id="search" name="query" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="Enter" type="submit" name="Enter" value="Search" />
#(searchdomswitches)#::
<div class="yacysearch">
#(searchtext)#::<input type="radio" id="text" name="contentdom" value="text" #(check)#::checked="checked"#(/check)# /><label for="text">Text</label>&nbsp;&nbsp;#(/searchtext)#
#(searchimage)#::<input type="radio" id="image" name="contentdom" value="image" #(check)#::checked="checked"#(/check)# /><label for="image">Images</label>&nbsp;&nbsp;#(/searchimage)#
#(searchaudio)#::<input type="radio" id="audio" name="contentdom" value="audio" #(check)#::checked="checked"#(/check)# /><label for="audio">Audio</label>&nbsp;&nbsp;#(/searchaudio)#
#(searchvideo)#::<input type="radio" id="video" name="contentdom" value="video" #(check)#::checked="checked"#(/check)# /><label for="video">Video</label>&nbsp;&nbsp;#(/searchvideo)#
#(searchapp)#::<input type="radio" id="app" name="contentdom" value="app" #(check)#::checked="checked"#(/check)# /><label for="app">Applications</label>#(/searchapp)#
&nbsp;
<a href="index.html?display=#[display]#&amp;searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#&amp;meanCount=#[meanCount]#">more options</a>
</div>
#(/searchdomswitches)#
<input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="maximumRecords" value="#[count]#" />
<input type="hidden" name="startRecord" value="#[offset]#" />
<input type="hidden" name="verify" value="#[verify]#" />
<input type="hidden" name="resource" value="#[resource]#" />
<input type="hidden" name="nav" value="all" />
<input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#" />
<input type="hidden" name="prefermaskfilter" value="#[prefermaskfilter]#" />
<input type="hidden" name="depth" value="#[depth]#" />
<input type="hidden" name="cat" value="#[cat]#" />
<input type="hidden" name="display" value="#[display]#" />
<input type="hidden" name="constraint" value="#[constraint]#" />
<input type="hidden" name="meanCount" value="#[meanCount]#" />
</fieldset>
</form>
#(didYouMean)#::
<p><b>Did you mean:</b> #{suggestions}# <a href="#[url]#">#[word]#</a> #[sep]##{/suggestions}#</p>
#(/didYouMean)#
#(searchagain)#
::

@ -1,35 +1,54 @@
<!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>#[former]# - YaCy '#[clientname]#': Search Page</title>
<title>YaCy '#[clientname]#': Location Search</title>
#%env/templates/metas.template%#
<link rel="alternate" type="application/rss+xml" title="Search for #[former]#" href="yacysearch.rss?search=#[former]#" />
<link rel="search" type="application/opensearchdescription+xml" title="YaCy Search on '#[clientname]#'" href="opensearchdescription.xml" />
<link rel="stylesheet" type="text/css" media="screen" href="/env/highslide.css" />
<script type="text/javascript">hs.outlineType = 'rounded-white';</script>
<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 = null;
function init() {
map = new OpenLayers.Map('map', {maxResolution:'auto'});
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
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");
layerTilesAtHome = new OpenLayers.Layer.OSM.Osmarender("Osmarender");
layerCycleMap = new OpenLayers.Layer.OSM.CycleMap("CycleMap");
map.addLayer(layerCycleMap);
map.addLayer(layerMaplint);
map.addLayer(layerWMS);
map.addLayer(layerMapnik);
map.addLayer(layerTilesAtHome);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0,0) // 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
);
}
function search() {
var query = document.getElementById('query').value.replace(' ', '+');
var newl = new OpenLayers.Layer.GeoRSS( 'GeoRSS', 'yacysearch_location.rss?query=' + query);
map.addLayer(newl);
if (searchLayer != null) searchLayer.destroy();
searchLayer = new OpenLayers.Layer.GeoRSS('GeoRSS', 'yacysearch_location.rss?query=' + query);
map.addLayer(searchLayer);
}
</script>
</head>
<body id="yacysearch_location" onload="init()">
<body id="yacysearch_location" onload="init();">
#(display)#
#%env/templates/simpleheader.template%#
::
@ -37,15 +56,14 @@
::
#%env/templates/embeddedheader.template%#
#(/display)#
<div style="float:left; width:70%;">
<div id="map" style="width: 600px; height: 300px"></div>
<br/>
<form onsubmit="return false;" class="search small" accept-charset="UTF-8">
<fieldset class="yacys">
<input type="text" id="query" size="42" />
<input type="submit" onclick="search(); return false;" value="search" onsubmit="search(); return false;" />
</fieldset>
</form>
</div>
<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" 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>

@ -43,14 +43,14 @@ public class yacysearch_location {
final serverObjects prop = new serverObjects();
prop.put("kml", 0);
if (post == null) return prop;
if (header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("kml") ||
header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("xml") ||
header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("rss")
) {
header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("xml") ||
header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("rss")
) {
// generate a kml output page
prop.put("kml", 1);
if (post == null) return prop;
String query = post.get("query", "");
long maximumTime = post.getLong("maximumTime", 1000);
int maximumRecords = post.getInt("maximumRecords", 100);
@ -95,8 +95,9 @@ public class yacysearch_location {
}
prop.put("kml_placemark", placemarkCounter);
} catch (InterruptedException e) {}
} if (header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("rss")) {
}
if (header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("rss")) {
if (post == null) return prop;
String promoteSearchPageGreeting = env.getConfig(SwitchboardConstants.GREETING, "");
if (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");
String hostName = header.get("Host", "localhost");
@ -114,12 +115,16 @@ public class yacysearch_location {
prop.put("kml_contentdom", (post == null ? "text" : post.get("contentdom", "text")));
prop.put("kml_verify", (post == null) ? "true" : post.get("verify", "true"));
} else if (header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("html")) {
}
if (header.get(HeaderFramework.CONNECTION_PROP_EXT, "").equals("html")) {
final Switchboard sb = (Switchboard) env;
final boolean authenticated = sb.adminAuthenticated(header) >= 2;
int display = (post == null) ? 0 : post.getInt("display", 0);
if (!authenticated) display = 2;
prop.put("display", display);
prop.put("promoteSearchPageGreeting", sb.getConfig(SwitchboardConstants.GREETING, ""));
prop.put("promoteSearchPageGreeting.homepage", sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));
prop.put("promoteSearchPageGreeting.smallImage", sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
}
// return rewrite properties

Loading…
Cancel
Save