Skip to content

Commit 560416e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into move_gesture
2 parents 309a6cc + ebc5622 commit 560416e

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

example/lib/pages/tile_builder.dart

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,27 @@ class TileBuilderPageState extends State<TileBuilderPage> {
3232
children: [
3333
tileWidget,
3434
if (showLoadingTime || showCoordinates)
35-
Column(
36-
mainAxisAlignment: MainAxisAlignment.center,
37-
children: [
38-
if (showCoordinates)
39-
Text(
40-
'${coords.x} : ${coords.y} : ${coords.z}',
41-
style: Theme.of(context).textTheme.headlineSmall,
42-
),
43-
if (showLoadingTime)
44-
Text(
45-
tile.loadFinishedAt == null
46-
? 'Loading'
47-
// sometimes result is negative which shouldn't happen, abs() corrects it
48-
: '${(tile.loadFinishedAt!.millisecond - tile.loadStarted!.millisecond).abs()} ms',
49-
style: Theme.of(context).textTheme.headlineSmall,
50-
),
51-
],
35+
FittedBox(
36+
fit: BoxFit.scaleDown,
37+
alignment: Alignment.center,
38+
child: Column(
39+
mainAxisAlignment: MainAxisAlignment.center,
40+
children: [
41+
if (showCoordinates)
42+
Text(
43+
'${coords.x} : ${coords.y} : ${coords.z}',
44+
style: Theme.of(context).textTheme.headlineSmall,
45+
),
46+
if (showLoadingTime)
47+
Text(
48+
tile.loadFinishedAt == null
49+
? 'Loading'
50+
// sometimes result is negative which shouldn't happen, abs() corrects it
51+
: '${(tile.loadFinishedAt!.millisecond - tile.loadStarted!.millisecond).abs()} ms',
52+
style: Theme.of(context).textTheme.headlineSmall,
53+
),
54+
],
55+
),
5256
),
5357
],
5458
),

lib/src/layer/tile_layer/tile_coordinates.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ class TileCoordinatesResolver {
7777
if (!replicatesWorldLongitude) {
7878
return positionCoordinates;
7979
}
80-
if (positionCoordinates.z < 0) {
80+
final z = positionCoordinates.z + zoomOffset;
81+
if (z < 0) {
8182
return positionCoordinates;
8283
}
83-
final modulo = 1 << (positionCoordinates.z + zoomOffset);
84+
final modulo = 1 << z;
8485
int x = positionCoordinates.x;
8586
while (x < 0) {
8687
x += modulo;

0 commit comments

Comments
 (0)