Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions greenstand/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ class Map{
}else if(this.capture_id){
this.sql = new SQLCase2();
this.sql.addUUIDFilter(this.capture_id);
}else if(this.timeline){
if(this.zoomLevel > 15){
this.sql = new SQLCase2Timeline();
this.sql.addTimeline(this.timeline);
this.sql.setBounds(this.bounds);
} else if ([12, 13, 14, 15].includes(this.zoomLevel) ) {
this.sql = new SQLCase3Timeline();
this.sql.setZoomLevel(this.zoomLevel);
this.sql.setBounds(this.bounds);
this.sql.addTimeline(this.timeline);
}else{
this.sql = new SQLCase1Timeline();
this.sql.addTimeline(this.timeline);
this.sql.setBounds(this.bounds);
this.sql.setZoomLevel(this.zoomLevel);
}
this.sql.addFilterByUserId(this.userid)
}else if(this.userid){
/*
* User map mode
Expand Down
3 changes: 3 additions & 0 deletions greenstand/sqls/SQLCase1Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class SQLCase1Timeline extends SQLCase1{
AND trees.time_created > '${begin}' AND trees.time_created < '${end}'
`;
}
if(this.userId){
result += "AND trees.planter_id = " + this.userId + " \n";
}
return result;
}
}
Expand Down
3 changes: 3 additions & 0 deletions greenstand/sqls/SQLCase2Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class SQLCase2Timeline extends SQLCase2{
AND trees.time_created > '${begin}' AND trees.time_created < '${end}'
`;
}
if(this.userId){
result += "AND trees.planter_id = " + this.userId + " \n";
}
return result;
}

Expand Down
3 changes: 3 additions & 0 deletions greenstand/sqls/SQLCase3Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class SQLCase3Timeline extends SQLCase3{
AND trees.time_created > '${begin}' AND trees.time_created < '${end}'
`;
}
if(this.userId){
result += "AND trees.planter_id = " + this.userId + " \n";
}
return result;
}

Expand Down