@@ -90,7 +90,7 @@ pub struct TileJSON {
90
90
/// covered by all zoom levels. The bounds are represented in WGS:84
91
91
/// latitude and longitude values, in the order left, bottom, right, top.
92
92
/// Values may be integers or floating point numbers.
93
- pub bounds : Option < Vec < i32 > > ,
93
+ pub bounds : Option < Vec < f32 > > ,
94
94
95
95
/// The first value is the longitude, the second is latitude (both in
96
96
/// WGS:84 values), the third value is the zoom level as an integer.
@@ -118,7 +118,7 @@ pub struct TileJSONBuilder {
118
118
data : Option < Vec < String > > ,
119
119
minzoom : Option < u8 > ,
120
120
maxzoom : Option < u8 > ,
121
- bounds : Option < Vec < i32 > > ,
121
+ bounds : Option < Vec < f32 > > ,
122
122
center : Option < Vec < i32 > > ,
123
123
}
124
124
@@ -139,7 +139,7 @@ impl TileJSONBuilder {
139
139
data : None ,
140
140
minzoom : Some ( 0 ) ,
141
141
maxzoom : Some ( 30 ) ,
142
- bounds : Some ( vec ! [ -180 , -90 , 180 , 90 ] ) ,
142
+ bounds : Some ( vec ! [ -180.0 , -90.0 , 180.0 , 90.0 ] ) ,
143
143
center : None ,
144
144
}
145
145
}
@@ -209,7 +209,7 @@ impl TileJSONBuilder {
209
209
self
210
210
}
211
211
212
- pub fn bounds ( & mut self , bounds : Vec < i32 > ) -> & mut TileJSONBuilder {
212
+ pub fn bounds ( & mut self , bounds : Vec < f32 > ) -> & mut TileJSONBuilder {
213
213
self . bounds = Some ( bounds) ;
214
214
self
215
215
}
@@ -298,7 +298,7 @@ mod tests {
298
298
299
299
assert_eq ! (
300
300
serialized_tilejson,
301
- r#"{"tilejson":"2.2.0","id":null,"name":"compositing","description":null,"version":"1.0.0","attribution":null,"template":null,"legend":null,"scheme":"tms","tiles":["http://localhost:8888/admin/1.0.0/world-light,broadband/{z}/{x}/{y}.png"],"grids":null,"data":null,"minzoom":0,"maxzoom":30,"bounds":[-180,-90,180,90],"center":null}"#
301
+ r#"{"tilejson":"2.2.0","id":null,"name":"compositing","description":null,"version":"1.0.0","attribution":null,"template":null,"legend":null,"scheme":"tms","tiles":["http://localhost:8888/admin/1.0.0/world-light,broadband/{z}/{x}/{y}.png"],"grids":null,"data":null,"minzoom":0,"maxzoom":30,"bounds":[-180.0 ,-90.0 ,180.0 ,90.0 ],"center":null}"#
302
302
)
303
303
}
304
304
}
0 commit comments