-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix case when the map is dragged inside scroll view (#2024)
* Fix case when the map is dragged inside scroll view * Add Example * Fix grammar Co-authored-by: Patrick Leonard <[email protected]> --------- Co-authored-by: Patrick Leonard <[email protected]>
- Loading branch information
1 parent
c00860c
commit 4367c15
Showing
3 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapScrollExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Foundation | ||
import SwiftUI | ||
@_spi(Experimental) import MapboxMaps | ||
|
||
@available(iOS 14.0, *) | ||
struct MapScrollExample: View { | ||
var body: some View { | ||
List { | ||
Section { | ||
Text("Test Map behaviour inside scroll.") | ||
.font(.title) | ||
.bold() | ||
} | ||
Section { | ||
Map(initialViewport: .followPuck(zoom: 18, bearing: .heading, pitch: 60)) { | ||
Puck2D(bearing: .heading) | ||
}.aspectRatio(1.0, contentMode: .fill) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@available(iOS 14.0, *) | ||
struct MapScrollExample_Previews: PreviewProvider { | ||
static var previews: some View { | ||
MapScrollExample() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters