fixes to location search

pull/1/head
Michael Peter Christen 13 years ago
parent 7acd7e88b3
commit 1ab3de0885

@ -15,11 +15,11 @@
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 path_mdsearch = 'yacysearch_location.rss?dom=alltext&query=';
var path_losearch = 'yacysearch_location.rss?dom=location&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
// possible values for dom: location,metatag,alltext,title,publisher,creator,subject
function init() {
map = new OpenLayers.Map('map', {
@ -51,7 +51,7 @@
#(initsearch)#::
var query = '#[query]#'.replace(' ', '+');
searchLayer_co = new OpenLayers.Layer.GeoRSS('GeoRSS', path_cosearch + query, {'icon':marker_co});
searchLayer_co = new OpenLayers.Layer.GeoRSS('GeoRSS', path_losearch + 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);
@ -63,7 +63,7 @@
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});
searchLayer_co = new OpenLayers.Layer.GeoRSS('GeoRSS', path_losearch + 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);

@ -54,7 +54,7 @@ public class yacysearch_location {
prop.put("kml", 1);
if (post == null) return prop;
final String query = post.get("query", "");
final boolean search_query = post.get("dom", "").indexOf("query",0) >= 0;
final boolean search_query = post.get("dom", "").indexOf("location",0) >= 0;
final boolean metatag = post.get("dom", "").indexOf("metatag",0) >= 0;
final boolean alltext = post.get("dom", "").indexOf("alltext",0) >= 0;
final boolean search_title = alltext || post.get("dom", "").indexOf("title",0) >= 0;
@ -97,6 +97,7 @@ public class yacysearch_location {
// take the results and compute some locations
RSSMessage message;
loop: while ((message = results.poll(maximumTime, TimeUnit.MILLISECONDS)) != RSSMessage.POISON) {
if (message == null) break loop;
// find all associated locations
final Set<Location> locations = new HashSet<Location>();

Loading…
Cancel
Save