Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
c05da905
Commit
c05da905
authored
Mar 25, 2015
by
Matija Obreza
Browse files
Geo: Don't join accession table when not needed
map.click used invalid filter names
parent
802c142f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/GenesysFilterServiceImpl.java
View file @
c05da905
...
...
@@ -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
()
{
...
...
src/main/resources/spring/spring.properties
View file @
c05da905
...
...
@@ -21,7 +21,7 @@ base.cookie-domain=
base.cookie-secure
=
false
base.cookie-http-only
=
false
db.url
=
jdbc:mysql://localhost/genesys
20141230
?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
...
...
src/main/webapp/WEB-INF/jsp/accession/map.jsp
View file @
c05da905
...
...
@@ -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
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment