kopia lustrzana https://github.com/osm2vectortiles/osm2vectortiles
				
				
				
			Extract tessera calls into functions
							rodzic
							
								
									6181ca0f22
								
							
						
					
					
						commit
						7bbcebbd32
					
				|  | @ -9,6 +9,14 @@ readonly PORT=${PORT:-80} | ||||||
| readonly CACHE_SIZE=${CACHE_SIZE:-10} | readonly CACHE_SIZE=${CACHE_SIZE:-10} | ||||||
| readonly SOURCE_CACHE_SIZE=${SOURCE_CACHE_SIZE:-10} | readonly SOURCE_CACHE_SIZE=${SOURCE_CACHE_SIZE:-10} | ||||||
| 
 | 
 | ||||||
|  | function serve_xray() { | ||||||
|  |     local mbtiles_file=$1 | ||||||
|  |     exec tessera "xray+mbtiles://$mbtiles_file" \ | ||||||
|  |         --PORT $PORT \ | ||||||
|  |         --cache-size $CACHE_SIZE \ | ||||||
|  |         --source-cache-size $SOURCE_CACHE_SIZE | ||||||
|  | } | ||||||
|  | 
 | ||||||
| # find first tm2 project | # find first tm2 project | ||||||
| if [ "$(ls -A $SOURCE_DATA_DIR)" ]; then | if [ "$(ls -A $SOURCE_DATA_DIR)" ]; then | ||||||
|     if [ -d "$SOURCE_DATA_DIR"/*.tm2 ]; then |     if [ -d "$SOURCE_DATA_DIR"/*.tm2 ]; then | ||||||
|  | @ -24,11 +32,7 @@ if [ "$(ls -A $SOURCE_DATA_DIR)" ]; then | ||||||
| 
 | 
 | ||||||
|         if [ -f "$MBTILES_FILE" ]; then |         if [ -f "$MBTILES_FILE" ]; then | ||||||
|             echo "The mbtiles file is now served with X-Ray styles" |             echo "The mbtiles file is now served with X-Ray styles" | ||||||
| 
 |             serve_xray "$MBTILES_FILE" | ||||||
|             exec tessera "xray+mbtiles://$MBTILES_FILE" \ |  | ||||||
|                 --PORT $PORT \ |  | ||||||
|                 --cache-size $CACHE_SIZE \ |  | ||||||
|                 --source-cache-size $SOURCE_CACHE_SIZE |  | ||||||
|         else |         else | ||||||
|             echo "No tm2 projects found. Please add a tm2 project to your mounted folder." |             echo "No tm2 projects found. Please add a tm2 project to your mounted folder." | ||||||
|             exit 404 |             exit 404 | ||||||
|  | @ -71,7 +75,12 @@ else | ||||||
|     exit 500 |     exit 500 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| exec tessera "tmstyle://$DEST_PROJECT_DIR" \ | function serve_style() { | ||||||
|  |     local style_dir=$1 | ||||||
|  |     exec tessera "tmstyle://$style_dir" \ | ||||||
|         --PORT $PORT \ |         --PORT $PORT \ | ||||||
|         --cache-size $CACHE_SIZE \ |         --cache-size $CACHE_SIZE \ | ||||||
|         --source-cache-size $SOURCE_CACHE_SIZE |         --source-cache-size $SOURCE_CACHE_SIZE | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | serve_style $DEST_PROJECT_DIR" | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Lukas Martinelli
						Lukas Martinelli