Fix tile sizes
This commit is contained in:
4
files/db/update_v16_to_v17.sql
Normal file
4
files/db/update_v16_to_v17.sql
Normal file
@@ -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';
|
||||
@@ -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()." ".
|
||||
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user