mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Local MBTiles source
This commit is contained in:
parent
f2a333b5df
commit
fae46080c7
9 changed files with 188 additions and 17 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue