Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let package = Package(
.package(url: "https://source.skip.tools/skip-sql.git", "0.14.0"..<"2.0.0"),
.package(url: "https://source.skip.tools/skip-web.git", "0.8.3"..<"2.0.0"),
.package(url: "https://source.skip.tools/skip-device.git", "0.4.2"..<"2.0.0"),
.package(url: "https://source.skip.tools/skip-gmaps.git", branch: "main"),
.package(url: "https://source.skip.tools/skip-motion.git", "0.7.2"..<"2.0.0"),
.package(url: "https://source.skip.tools/skip-keychain.git", "0.3.2"..<"2.0.0"),
.package(url: "https://source.skip.tools/skip-marketplace.git", "0.2.1"..<"2.0.0"),
Expand All @@ -30,6 +31,7 @@ let package = Package(
.product(name: "SkipSQL", package: "skip-sql"),
.product(name: "SkipWeb", package: "skip-web"),
.product(name: "SkipDevice", package: "skip-device"),
.product(name: "SkipGMaps", package: "skip-gmaps"),
.product(name: "SkipMotion", package: "skip-motion"),
.product(name: "SkipKeychain", package: "skip-keychain"),
.product(name: "SkipMarketplace", package: "skip-marketplace"),
Expand Down
52 changes: 50 additions & 2 deletions Sources/Showcase/MapPlayground.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2023–2025 Skip
import SwiftUI
import SkipGMaps
#if !SKIP
import MapKit
#else
Expand All @@ -9,13 +10,60 @@ import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
#endif

enum MapPlaygroundType: String, CaseIterable {
case platform
case google

var title: String {
switch self {
case .platform:
return "Platform Map"
case .google:
return "Google Maps"
}
}
}

struct MapPlayground: View {

var body: some View {
List(MapPlaygroundType.allCases, id: \.self) { type in
NavigationLink(type.title, value: type)
}
.toolbar {
PlaygroundSourceLink(file: "MapPlayground.swift")
}
.navigationDestination(for: MapPlaygroundType.self) {
switch $0 {
case .platform:
PlatformMapPlayground()
.navigationTitle($0.title)
case .google:
GMapsPlayground()
.navigationTitle($0.title)
}
}
}
}

struct GMapsPlayground: View {
init() {
GoogleMapsConfiguration.provideAPIKey("AIzaSyBdt_bhz4zi6WAUelkVkEnxMs9pkbEKXKM")
}

var body: some View {
GoogleMapView()
}
}


struct PlatformMapPlayground: View {
var body: some View {
MapView(latitude: 48.8566, longitude: 2.3522)
SimpleMapView(latitude: 48.8566, longitude: 2.3522)
}
}

struct MapView : View {
struct SimpleMapView : View {
let latitude: Double
let longitude: Double

Expand Down
2 changes: 1 addition & 1 deletion Sources/Showcase/Skip/skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ build:
- block: 'dependencies'
contents:
# dependency used by MapPlayground for custom compose integration
- 'implementation("com.google.maps.android:maps-compose:6.4.1")'
#- 'implementation("com.google.maps.android:maps-compose:6.4.1")'
Loading