Skip to content

Commit 1af46e8

Browse files
committed
Move to uncompressed OSM style resources
On each new map that is displayed maplibre is opening the font assets and decompressing them. By storing the resources uncompressed it makes this much more efficient.
1 parent 120872f commit 1af46e8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

app/build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,20 @@ android {
189189
excludes += "/META-INF/{AL2.0,LGPL2.1}"
190190
}
191191
}
192+
androidResources {
193+
// Keep the map style assets stored uncompressed in the APK. "pbf" is unique to the
194+
// glyph fonts in this folder; the style JSON/sprite PNGs need exact paths since those
195+
// extensions are also used elsewhere in the app.
196+
noCompress += listOf(
197+
"pbf",
198+
"assets/osm-liberty-accessible/style.json",
199+
"assets/osm-liberty-accessible/originalStyle.json",
200+
"assets/osm-liberty-accessible/osm-liberty.json",
201+
"assets/osm-liberty-accessible/osm-liberty@2x.json",
202+
"assets/osm-liberty-accessible/osm-liberty.png",
203+
"assets/osm-liberty-accessible/osm-liberty@2x.png",
204+
)
205+
}
192206
externalNativeBuild {
193207
cmake {
194208
path = file("src/main/cpp/CMakeLists.txt")

0 commit comments

Comments
 (0)