Local MBTiles source

This commit is contained in:
Joshua Pirihi 2022-01-17 14:03:48 +13:00
parent f2a333b5df
commit fae46080c7
9 changed files with 188 additions and 17 deletions

View file

@ -97,7 +97,7 @@ public struct MapView: UIViewRepresentable {
//self.annotations = annotations
self.locationNodes = locationNodes
//self.locationNodes = locationNodes
self.overlays = overlays
@ -135,22 +135,10 @@ public struct MapView: UIViewRepresentable {
if self.customMapOverlay != self.presentCustomMapOverlayHash {
mapView.removeOverlays(mapView.overlays)
if let customMapOverlay = self.customMapOverlay {
let overlay = CustomMapOverlaySource(
parent: self,
mapName: customMapOverlay.mapName,
tileType: customMapOverlay.tileType,
defaultTile: customMapOverlay.defaultTile
)
if let minZ = customMapOverlay.minimumZoomLevel {
overlay.minimumZ = minZ
}
let overlay = LocalMBTileOverlay(mbTilePath: Bundle.main.path(forResource: "offline_map", ofType: "mbtiles")!)
if let maxZ = customMapOverlay.maximumZoomLevel {
overlay.maximumZ = maxZ
}
overlay.canReplaceMapContent = customMapOverlay.canReplaceMapContent
overlay.canReplaceMapContent = false//customMapOverlay.canReplaceMapContent
mapView.addOverlay(overlay)
}