Store maps (layers) settings in DB + display only project-relevant layers

This commit is contained in:
2020-08-18 23:12:40 +02:00
parent 4c4f83b6a2
commit b0b283cf0f
4 changed files with 80 additions and 18 deletions

View File

@@ -168,6 +168,16 @@ class Project extends PhpObject {
return $iLastUpdate;
}
public function getMaps() {
$sQuery =
"SELECT codename, geo_name, min_zoom, max_zoom, attribution ".
"FROM ".Spot::MAPPING_TABLE." ".
"LEFT JOIN ".Spot::MAP_TABLE." USING(".Db::getId(Spot::MAP_TABLE).") ".
"WHERE ".Db::getId(self::PROJ_TABLE)." = ".$this->getProjectId()." ".
"OR ".Db::getId(self::PROJ_TABLE)." IS NULL ";
return $this->oDb->getArrayQuery($sQuery, true);
}
private function setProjectInfo() {
if($this->getProjectId() > 0) {
$asProject = $this->getProject();