-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from hactar/enhancement/pat-gestures
Feature Gestures
- Loading branch information
Showing
7 changed files
with
103 additions
and
14 deletions.
There are no files selected for viewing
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,32 @@ | ||
import CoreLocation | ||
import MapLibre | ||
import MapLibreSwiftDSL | ||
import SwiftUI | ||
|
||
#Preview("Tappable Circles") { | ||
let tappableID = "simple-circles" | ||
return MapView(styleURL: demoTilesURL) { | ||
// Simple symbol layer demonstration with an icon | ||
CircleStyleLayer(identifier: tappableID, source: pointSource) | ||
.radius(16) | ||
.color(.systemRed) | ||
.strokeWidth(2) | ||
.strokeColor(.white) | ||
|
||
SymbolStyleLayer(identifier: "simple-symbols", source: pointSource) | ||
.iconImage(UIImage(systemName: "mappin")!.withRenderingMode(.alwaysTemplate)) | ||
.iconColor(.white) | ||
} | ||
.onTapMapGesture(on: [tappableID], onTapChanged: { _, features in | ||
print("Tapped on \(features.first)") | ||
}) | ||
.ignoresSafeArea(.all) | ||
} | ||
|
||
#Preview("Tappable Countries") { | ||
MapView(styleURL: demoTilesURL) | ||
.onTapMapGesture(on: ["countries-fill"], onTapChanged: { _, features in | ||
print("Tapped on \(features.first)") | ||
}) | ||
.ignoresSafeArea(.all) | ||
} |
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
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
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