@@ -196,8 +196,8 @@ impl TileSchemaBuilder {
196196 const TILE_SIZE : u32 = 256 ;
197197
198198 Self :: web_mercator_base ( )
199- . with_logarithmic_z_levels ( z_levels)
200- . with_rect_tile_size ( TILE_SIZE )
199+ . logarithmic_z_levels ( z_levels)
200+ . rect_tile_size ( TILE_SIZE )
201201 }
202202
203203 fn web_mercator_base ( ) -> Self {
@@ -225,15 +225,27 @@ impl TileSchemaBuilder {
225225 }
226226 }
227227
228- /// Set both tile width and height to `tile_size`.
229- pub fn with_rect_tile_size ( mut self , tile_size : u32 ) -> Self {
228+ /// Set both tile width and height to `tile_size` in pixels .
229+ pub fn rect_tile_size ( mut self , tile_size : u32 ) -> Self {
230230 self . tile_width = tile_size;
231231 self . tile_height = tile_size;
232232
233233 self
234234 }
235235
236- fn with_logarithmic_z_levels ( mut self , z_levels : impl IntoIterator < Item = u32 > ) -> Self {
236+ /// Set width of the tiles in pixels.
237+ pub fn tile_width ( mut self , width : u32 ) -> Self {
238+ self . tile_width = width;
239+ self
240+ }
241+
242+ /// Set height of the tiles in pixels.
243+ pub fn tile_height ( mut self , height : u32 ) -> Self {
244+ self . tile_height = height;
245+ self
246+ }
247+
248+ fn logarithmic_z_levels ( mut self , z_levels : impl IntoIterator < Item = u32 > ) -> Self {
237249 self . lods = Lods :: Logarithmic ( z_levels. into_iter ( ) . collect ( ) ) ;
238250
239251 self
@@ -244,7 +256,7 @@ impl TileSchemaBuilder {
244256 /// Z-levels are given as tuples of `(z-index, resolution)`. Smaller z-indexes must correspond
245257 /// to larger resolution values. If z-levels are not sorted correctly, building the tile schema
246258 /// would result in [`TileSchemaError::NotSortedZLevels`] error.
247- pub fn with_z_levels ( mut self , z_levels : impl IntoIterator < Item = ( u32 , f64 ) > ) -> Self {
259+ pub fn z_levels ( mut self , z_levels : impl IntoIterator < Item = ( u32 , f64 ) > ) -> Self {
248260 self . lods = Lods :: Custom ( z_levels. into_iter ( ) . collect ( ) ) ;
249261 self
250262 }
@@ -414,7 +426,7 @@ mod tests {
414426 #[ test]
415427 fn zero_tile_size ( ) {
416428 let result = TileSchemaBuilder :: web_mercator ( 0 ..=20 )
417- . with_rect_tile_size ( 0 )
429+ . rect_tile_size ( 0 )
418430 . build ( ) ;
419431 assert ! (
420432 matches!(
@@ -510,7 +522,7 @@ mod tests {
510522 }
511523
512524 let tile_schema = TileSchemaBuilder :: web_mercator ( 0 ..0 )
513- . with_z_levels ( lods)
525+ . z_levels ( lods)
514526 . build ( )
515527 . unwrap ( ) ;
516528
@@ -526,7 +538,7 @@ mod tests {
526538 #[ test]
527539 fn custom_z_levels_check_for_min_resolution ( ) {
528540 let result = TileSchemaBuilder :: web_mercator ( 0 ..0 )
529- . with_z_levels ( [ ( 0 , TOP_RESOLUTION ) , ( 1 , TOP_RESOLUTION / 2f64 . powi ( 65 ) ) ] )
541+ . z_levels ( [ ( 0 , TOP_RESOLUTION ) , ( 1 , TOP_RESOLUTION / 2f64 . powi ( 65 ) ) ] )
530542 . build ( ) ;
531543 assert ! (
532544 matches!(
@@ -550,9 +562,7 @@ mod tests {
550562 lods[ 1 ] . 0 = 1 ;
551563 lods[ 2 ] . 0 = 2 ;
552564
553- let result = TileSchemaBuilder :: web_mercator ( 0 ..0 )
554- . with_z_levels ( lods)
555- . build ( ) ;
565+ let result = TileSchemaBuilder :: web_mercator ( 0 ..0 ) . z_levels ( lods) . build ( ) ;
556566
557567 assert ! (
558568 matches!(
@@ -623,7 +633,7 @@ mod tests {
623633 let result = TileSchemaBuilder :: web_mercator ( 0 ..18 )
624634 . world_bounds ( bounds)
625635 . wrap_x ( false )
626- . with_z_levels ( [ ( 0 , 1000.0 ) , ( 1 , 500.0 ) ] )
636+ . z_levels ( [ ( 0 , 1000.0 ) , ( 1 , 500.0 ) ] )
627637 . build ( ) ;
628638 assert ! (
629639 result. is_ok( ) ,
0 commit comments