Skip to content

Commit

Permalink
fix(android): prevent random, missing tiles if caching locally (#4598)
Browse files Browse the repository at this point in the history
Before this change, the else if statement on 216 would never run since
the condition (`image == null && !this.offlineMode`) matches the
previous if statement. Making it an independent if statement fixes
the issue.

Fixes: #4477
  • Loading branch information
stdavis committed Apr 28, 2023
1 parent 08c1695 commit 668e837
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android/src/main/java/com/rnmaps/maps/MapTileProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ byte[] getTileImage(int x, int y, int zoom) {
} catch (Exception e) {
e.printStackTrace();
}
} else if (image == null && !this.offlineMode) {
}

if (image == null && !this.offlineMode) {
Log.d("urlTile", "Normal fetch");
image = fetchTile(x, y, zoom);
if (image == null) {
Expand Down

0 comments on commit 668e837

Please sign in to comment.