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 { ...@@ -223,15 +223,17 @@ public class GenesysFilterServiceImpl implements GenesysFilterService {
} }
final DirectMysqlQuery directQuery = new DirectMysqlQuery("accessiongeo", "geo"); final DirectMysqlQuery directQuery = new DirectMysqlQuery("accessiongeo", "geo");
directQuery.innerJoin("accession", "a", "a.id=geo.accessionId");
directQuery.join(filters);
directQuery.filterTile(zoom, xtile, ytile); directQuery.filterTile(zoom, xtile, ytile);
directQuery.filter(filters, new MethodResolver() { if (! filters.isEmpty()) {
@Override directQuery.innerJoin("accession", "a", "a.id=geo.accessionId");
public Method getMethod(long methodId) { directQuery.join(filters);
return methodRepository.findOne(methodId); directQuery.filter(filters, new MethodResolver() {
} @Override
}); public Method getMethod(long methodId) {
return methodRepository.findOne(methodId);
}
});
}
directQuery.limit(limit); directQuery.limit(limit);
this.jdbcTemplate.query(new PreparedStatementCreator() { this.jdbcTemplate.query(new PreparedStatementCreator() {
......
...@@ -21,7 +21,7 @@ base.cookie-domain= ...@@ -21,7 +21,7 @@ base.cookie-domain=
base.cookie-secure=false base.cookie-secure=false
base.cookie-http-only=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.driverClassName=com.mysql.jdbc.Driver
db.username=root db.username=root
db.password= db.password=
...@@ -50,7 +50,7 @@ itpgrfa.easysmta.password=foo ...@@ -50,7 +50,7 @@ itpgrfa.easysmta.password=foo
google.analytics.account= google.analytics.account=
# CDN # CDN
cdn.server=https://s1.cdn.genesys-pgr.org cdn.server=${base.url}
cdn.base=${cdn.server} cdn.base=${cdn.server}
cdn.flags.url=${cdn.base}/html/flags cdn.flags.url=${cdn.base}/html/flags
...@@ -117,7 +117,7 @@ scheduler.tokens.cleanup.hours=1 ...@@ -117,7 +117,7 @@ scheduler.tokens.cleanup.hours=1
# TileServer CDN # TileServer CDN
#tileserver.cdn='https://s1' #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='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 # TileServer Cache
cache.defaultCacheSize=5000 cache.defaultCacheSize=5000
......
...@@ -186,8 +186,8 @@ ...@@ -186,8 +186,8 @@
// Do something when the bounds change. // Do something when the bounds change.
// Bounds are available in `e.bounds`. // Bounds are available in `e.bounds`.
var bounds=locationFilter.getBounds(); var bounds=locationFilter.getBounds();
filterJson["geo.latitude"]=[{range:[bounds.getSouth(),bounds.getNorth()]}]; filterJson['geo.latitude']=[{range:[bounds.getSouth(),bounds.getNorth()]}];
filterJson["geo.longitude"]=[{range:[bounds.getWest(),bounds.getEast()]}]; filterJson['geo.longitude']=[{range:[bounds.getWest(),bounds.getEast()]}];
}); });
map.on("viewreset", function() { map.on("viewreset", function() {
...@@ -199,8 +199,8 @@ ...@@ -199,8 +199,8 @@
locationFilter.on("enabled", function () { locationFilter.on("enabled", function () {
// Do something when enabled. // Do something when enabled.
var bounds=locationFilter.getBounds(); var bounds=locationFilter.getBounds();
filterJson["geo.latitude"]=[{range:[bounds.getSouth(),bounds.getNorth()]}]; filterJson['geo.latitude']=[{range:[bounds.getSouth(),bounds.getNorth()]}];
filterJson["geo.longitude"]=[{range:[bounds.getWest(),bounds.getEast()]}]; filterJson['geo.longitude']=[{range:[bounds.getWest(),bounds.getEast()]}];
$("#selectArea").show(); $("#selectArea").show();
}); });
...@@ -234,8 +234,8 @@ ...@@ -234,8 +234,8 @@
var filterBounds=filterJsonObj; var filterBounds=filterJsonObj;
console.log(filterBounds) console.log(filterBounds)
filterBounds.latitude=[{range:[sw.lat, ne.lat]}]; filterBounds['geo.latitude']=[{range:[sw.lat, ne.lat]}];
filterBounds.longitude=[{range:[sw.lng, ne.lng]}]; filterBounds['geo.longitude']=[{range:[sw.lng, ne.lng]}];
//console.log(JSON.stringify(filterBounds)); //console.log(JSON.stringify(filterBounds));
$.ajax("<c:url value="/explore/geoJson"><c:param name="limit" value="11" /></c:url>&filter="+JSON.stringify(filterBounds), { $.ajax("<c:url value="/explore/geoJson"><c:param name="limit" value="11" /></c:url>&filter="+JSON.stringify(filterBounds), {
type : "GET", 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