diff --git a/files/db/update_v16_to_v17.sql b/files/db/update_v16_to_v17.sql new file mode 100644 index 0000000..23ac295 --- /dev/null +++ b/files/db/update_v16_to_v17.sql @@ -0,0 +1,4 @@ +INSERT INTO maps (codename, geo_name, min_zoom, max_zoom, attribution) VALUES ('outdoors', 'mapbox.outdoors', 0, 19, ''); +ALTER TABLE maps ADD COLUMN tile_size SMALLINT UNSIGNED DEFAULT 256 AFTER geo_name; +UPDATE maps SET tile_size = 512 WHERE geo_name = 'mapbox.outdoors'; +UPDATE maps SET tile_size = 512 WHERE geo_name = 'mapbox.satellite-streets'; \ No newline at end of file diff --git a/inc/Project.php b/inc/Project.php index 98b2d6e..624b9ac 100644 --- a/inc/Project.php +++ b/inc/Project.php @@ -177,7 +177,7 @@ class Project extends PhpObject { public function getMaps() { $sQuery = - "SELECT codename, geo_name, min_zoom, max_zoom, attribution ". + "SELECT codename, geo_name, tile_size, 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()." ". diff --git a/inc/Spot.php b/inc/Spot.php index 40fdf7b..60307f5 100755 --- a/inc/Spot.php +++ b/inc/Spot.php @@ -104,7 +104,7 @@ class Spot extends Main self::POST_TABLE => array(Db::getId(Project::PROJ_TABLE), Db::getId(User::USER_TABLE), 'name', 'content', 'site_time', 'timezone'), Media::MEDIA_TABLE => array(Db::getId(Project::PROJ_TABLE), 'filename', 'type', 'taken_on', 'posted_on', 'timezone', 'rotate', 'comment'), User::USER_TABLE => array('name', 'email', 'gravatar', 'language', 'timezone', 'active', 'clearance'), - self::MAP_TABLE => array('codename', 'geo_name', 'min_zoom', 'max_zoom', 'attribution'), + self::MAP_TABLE => array('codename', 'geo_name', 'tile_size', 'min_zoom', 'max_zoom', 'attribution'), self::MAPPING_TABLE => array(Db::getId(self::MAP_TABLE) , Db::getId(Project::PROJ_TABLE)) ), 'types' => array @@ -145,7 +145,8 @@ class Spot extends Main 'gravatar' => "LONGTEXT", 'weather_icon' => "VARCHAR(30)", 'weather_cond' => "VARCHAR(30)", - 'weather_temp' => "DECIMAL(3,1)" + 'weather_temp' => "DECIMAL(3,1)", + 'tile_size' => "SMALLINT UNSIGNED DEFAULT 256" ), 'constraints' => array ( diff --git a/languages/en.lang b/languages/en.lang index dda6518..a298ee0 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -35,6 +35,7 @@ map_ign_spain = IGN (Spain) map_linz = LINZ map_usgs = USGS map_natgeo = National Geographic +map_outdoors = Mapbox Outdoors image = Picture images = Pictures diff --git a/languages/fr.lang b/languages/fr.lang index 81fe0bc..4d37a69 100644 --- a/languages/fr.lang +++ b/languages/fr.lang @@ -35,6 +35,7 @@ map_ign_spain = IGN (Espagne) map_linz = LINZ map_usgs = USGS map_natgeo = National Geographic +map_outdoors = Mapbox Topo image = Photo images = Photos diff --git a/masks/project.html b/masks/project.html index e6bb5cd..377871f 100644 --- a/masks/project.html +++ b/masks/project.html @@ -368,6 +368,8 @@ function setMapLayers(asLayers) { $.each(asLayers, function(iKey, asLayer) { oSpot.tmp('layers')[oSpot.lang('map_'+asLayer.codename)] = L.tileLayer(self.tmp('tile_api'), { id: asLayer.geo_name, + tileSize: parseInt(asLayer.tile_size), + zoomOffset: (parseInt(asLayer.tile_size) / -256 + 1), minZoom: parseInt(asLayer.min_zoom), maxZoom: parseInt(asLayer.max_zoom), attribution: asLayer.attribution