Commit c05da905 authored by Matija Obreza's avatar Matija Obreza
Browse files

Geo: Don't join accession table when not needed

map.click used invalid filter names
parent 802c142f
......@@ -223,15 +223,17 @@ public class GenesysFilterServiceImpl implements GenesysFilterService {
}
final DirectMysqlQuery directQuery = new DirectMysqlQuery("accessiongeo", "geo");
directQuery.innerJoin("accession", "a", "a.id=geo.accessionId");
directQuery.join(filters);
directQuery.filterTile(zoom, xtile, ytile);
directQuery.filter(filters, new MethodResolver() {
@Override
public Method getMethod(long methodId) {
return methodRepository.findOne(methodId);
}
});
if (! filters.isEmpty()) {
directQuery.innerJoin("accession", "a", "a.id=geo.accessionId");
directQuery.join(filters);
directQuery.filter(filters, new MethodResolver() {
@Override
public Method getMethod(long methodId) {
return methodRepository.findOne(methodId);
}
});
}
directQuery.limit(limit);
this.jdbcTemplate.query(new PreparedStatementCreator() {
......
......@@ -21,7 +21,7 @@ base.cookie-domain=
base.cookie-secure=false
base.cookie-http-only=false
db.url=jdbc:mysql://localhost/genesys20141230?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
db.url=jdbc:mysql://localhost/genesys?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
db.driverClassName=com.mysql.jdbc.Driver
db.username=root
db.password=
......@@ -50,7 +50,7 @@ itpgrfa.easysmta.password=foo
google.analytics.account=
# CDN
cdn.server=https://s1.cdn.genesys-pgr.org
cdn.server=${base.url}
cdn.base=${cdn.server}
cdn.flags.url=${cdn.base}/html/flags
......@@ -117,7 +117,7 @@ scheduler.tokens.cleanup.hours=1
# TileServer CDN
#tileserver.cdn='https://s1'
#tileserver.cdn='https://s1.cdn.genesys-pgr.org','https://s2.cdn.genesys-pgr.org','https://s3.cdn.genesys-pgr.org','https://s4.cdn.genesys-pgr.org'
tileserver.cdn='http://localhost:8080'
tileserver.cdn='${base.url}'
# TileServer Cache
cache.defaultCacheSize=5000
......
......@@ -186,8 +186,8 @@
// Do something when the bounds change.
// Bounds are available in `e.bounds`.
var bounds=locationFilter.getBounds();
filterJson["geo.latitude"]=[{range:[bounds.getSouth(),bounds.getNorth()]}];
filterJson["geo.longitude"]=[{range:[bounds.getWest(),bounds.getEast()]}];
filterJson['geo.latitude']=[{range:[bounds.getSouth(),bounds.getNorth()]}];
filterJson['geo.longitude']=[{range:[bounds.getWest(),bounds.getEast()]}];
});
map.on("viewreset", function() {
......@@ -199,8 +199,8 @@
locationFilter.on("enabled", function () {
// Do something when enabled.
var bounds=locationFilter.getBounds();
filterJson["geo.latitude"]=[{range:[bounds.getSouth(),bounds.getNorth()]}];
filterJson["geo.longitude"]=[{range:[bounds.getWest(),bounds.getEast()]}];
filterJson['geo.latitude']=[{range:[bounds.getSouth(),bounds.getNorth()]}];
filterJson['geo.longitude']=[{range:[bounds.getWest(),bounds.getEast()]}];
$("#selectArea").show();
});
......@@ -234,8 +234,8 @@
var filterBounds=filterJsonObj;
console.log(filterBounds)
filterBounds.latitude=[{range:[sw.lat, ne.lat]}];
filterBounds.longitude=[{range:[sw.lng, ne.lng]}];
filterBounds['geo.latitude']=[{range:[sw.lat, ne.lat]}];
filterBounds['geo.longitude']=[{range:[sw.lng, ne.lng]}];
//console.log(JSON.stringify(filterBounds));
$.ajax("<c:url value="/explore/geoJson"><c:param name="limit" value="11" /></c:url>&filter="+JSON.stringify(filterBounds), {
type : "GET",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment