Demo in SwiftUI of Apple Map, Google Map, and Mapbox map

Overview

SNMapServices

swift-version swiftui-version

SNMapServices is a serices for iOS written in SwiftUI. It provides Map capability by subclassing Mapbox, Google map and Apple map. This Service is an easy to use drawer library meant to imitate the drawer in iOS 14/15's Maps app. It exposes a simple class that allows you to use any SwiftUI view subclass as the drawer content or the primary content.

Usages 🔥

This service can be comparable for Apple, Google and Mapbox map. It will useful for tracking user location, adding annotation pin on map, customize annotation views and user current location view, handle annotation's click and also change map style, type and their regions behaviour.

Language

  • SwiftUI

Requirements 📝

  • Swift 5.0+
  • iOS 14.0+
  • Xcode 12+

Preview

Setup Manager

To install in project first you need to drag and drop the sources folder into your project.

Apple Map

Set region of current map, number annotation, map type(standard, satellite, hybrid), user tracking mode and user location.

    @Published var region: MKCoordinateRegion
    @Published var pins: [AnnotationPin] = [.t1, .t2, .t3, .t4]
    
    var mapType: MKMapType = .standard
    var userTrackingMode: MKUserTrackingMode = .follow
    var showUserLocation = true
    
    var body: some View { 
      SNAppleMapView(region: region, 
                     pin: pins, 
                     mapType: mapType, 
                     userTrackingMode: userTrackingMode, 
                     showsUserLocation: showUserLocation) { annotation in
                           <#code#>
                          // Handle here annotation tapped
                   }
    }

Google Map

Setup Google map console Google Map Documentation

GMSServices.provideAPIKey("YOUR_API_KEY")

Set current visible region location, annotations pins, user location enable and maps type.

    @StateObject var currentLocation: CLLocationCoordinate2D
    @StateObject var pins: [AnnotationPin] = [.t1, .t2, .t3, .t4]
    
    var mapType: GMSMapViewType = .normal
    var isShowCurrentLocation = true
    
    var body: some View {
      SNGoogleMapView(currentRegionCenterLocation: $currentLocation,
                      pins: $pins,
                      isMyLocationEnabled: isShowCurrentLocation,
                      mapType: mapType) { location in
                         <#code#>
                         // Handle here annotation tapped
                    }
     }

Mapbox Map

Setup Mapbox Mapbox Documentation

pod 'Mapbox-iOS-SDK'
<key>MGLMapboxAccessToken</key>
	<string>YOUR_MAPBOX_ACCRSS_TOKEN</string>

Set current visible region location, annotations pins, user location enable and User tracking mode.

    @StateObject var currentLocation: CLLocationCoordinate2D
    @StateObject var pins: [AnnotationPin] = [.t1, .t2, .t3, .t4]
    
    var isShowCurrentLocation = true
    var userTrackingMode: MGLUserTrackingMode = .follow
    
    var body: some View {
        SNMapBoxView(currentRegionCenterLocation: $currentLocation,
                     pins: $pins,
                     userTrackingMode: userTrackingMode,
                     isShowCurrentLocation: isShowCurrentLocation) { annotation in
                     
                     <#code#>
                     // Handle here annotation tapped
                    }
    }

Contact Us

For any query feel free to connect at [email protected].

You might also like...
Allows you to use custom maps in iphone applications and attempts to mimics some of the behaviour of the MapKit framework
Allows you to use custom maps in iphone applications and attempts to mimics some of the behaviour of the MapKit framework

NAMapKit Lets you drop pins or custom annotations onto a standard UIImage or a tiled NATiledImageView. Includes callouts, multi-colored pins, animatio

An iOS map clustering framework targeting MapKit, Google Maps and Mapbox.
An iOS map clustering framework targeting MapKit, Google Maps and Mapbox.

ClusterKit is an elegant and efficiant clustering controller for maps. Its flexible architecture make it very customizable, you can use your own algor

Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ measurement protocol for Apple TV.

Google Analytics tracker for Apple tvOS by Adswerve About Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ me

An exercise to use a map(google map) for navigation.

map-navigation An exercise to use a map(google map) for navigation. It have the features of navigating your for a destination, drawing your travel pat

Google-Blogger-iOS-App - Using Google Blogger API to build an iOS app like Medium

Google Blogger iOS App Using Google Blogger API to build an iOS app like Medium!

MSFlightMapView allows you to easily add and animate geodesic flights to Google map

MSFlightMapView Demo Requirements iOS 10.0+ Xcode 9.0+ Installation Just add the MSFlightMapView folder to your project. or use CocoaPods: pod 'MSFlig

This Google Cast demo app shows how to cast videos from an iOS device in a way that is fully compliant with the Cast Design Checklist.

CastVideos-ios (reference iOS sender app) This Google Cast demo app shows how to cast videos from an iOS device in a way that is fully compliant with

Social Media platform build with swiftUI and Firebase with google and apple account integration for Signing In Users
Social Media platform build with swiftUI and Firebase with google and apple account integration for Signing In Users

Social Media platform build with swiftUI and Firebase with google and apple account integration for Signing In Users . Providing Users availability to upload posts and images add caption allowing other users to comment , with Find section to explore new people , new stories , User Profile section to allow the user to take control of his account .

Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator
Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator

Swifty-OCR-Translator Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator Usage Select Translator Fill in the AP

This app demonstrates how to use the Google Cloud Speech API and Apple on-device Speech library to recognize speech in live recorded audio.

SpeechRecognitionIOS This app demonstrates how to use Google Cloud Speech API and Apple on-device Speech library to recognize speech in live audio rec

Google ProtocolBuffers for Apple Swift
Google ProtocolBuffers for Apple Swift

Protocol Buffers for Swift An implementation of Protocol Buffers in Swift. Protocol Buffers are a way of encoding structured data in an efficient yet

Google ProtocolBuffers for Apple Swift
Google ProtocolBuffers for Apple Swift

Protocol Buffers for Swift An implementation of Protocol Buffers in Swift. Protocol Buffers are a way of encoding structured data in an efficient yet

Px-mobile-sdk-demo-app - PerimeterX Mobile SDK - Demo App
Px-mobile-sdk-demo-app - PerimeterX Mobile SDK - Demo App

About PerimeterX PerimeterX is the leading provider of application security solu

Sign in with Apple, Sign up with Apple, or Continue with Apple

ContinueWithApple Sign in with Apple, Sign up with Apple, or Continue with Apple Utils 1. randomNonceString 로그인 요청마다 임의의 문자열인 'nonce'가 생성되며, 이 'nonce'

Official demo app released by Apple to teach SwiftUI

Landmarks This repository contains a demo application that I developed while following Apple's SwiftUI tutorials. Cloning Clone the repository using c

MiniVendingMachine - SwiftUI demo Apple Watch app to open a mini vending machine via bluetooth

Mini Vending Machine Use Apple Watch to open vending machine cells. Note: This a

iOS native app demo with Xcode and Swift using MVVM architecture and Apple's Combine framework for functional reactive programming, all with UIKit
iOS native app demo with Xcode and Swift using MVVM architecture and Apple's Combine framework for functional reactive programming, all with UIKit

iOS (Swift 5): MVVM test with Combine and UIKit MVVM and functional reactive programming (FRP) are very used in iOS development inside companies. Here

Smart Online Shopping iOS App with Augmented Reality (AR) and simple Social Media features using SwiftUI and Google Firebase Cloud Services
Smart Online Shopping iOS App with Augmented Reality (AR) and simple Social Media features using SwiftUI and Google Firebase Cloud Services

Table of contents App Demo How to Run Context Content How it's written Inspiration App Demo AR.online.shopping.iOS.demo.mp4 How to Run First make sure

Booky heavily-commented demo app built to explore Apple's new 'App Intents' framework introduced in iOS 16
Booky heavily-commented demo app built to explore Apple's new 'App Intents' framework introduced in iOS 16

Booky Demo App ℹ️ ABOUT Booky is a work-in-progress, heavily-commented demo app built to explore Apple's new 'App Intents' framework introduced in iOS

Owner
Softnoesis
Service and Product based mobile application and website development company.
Softnoesis
MSFlightMapView allows you to easily add and animate geodesic flights to Google map

MSFlightMapView Demo Requirements iOS 10.0+ Xcode 9.0+ Installation Just add the MSFlightMapView folder to your project. or use CocoaPods: pod 'MSFlig

Muhammad Abdul Subhan 48 Aug 13, 2022
Google Directions API helper for iOS, written in Swift

PXGoogleDirections Google Directions API SDK for iOS, entirely written in Swift. ?? Features Supports all features from the Google Directions API as o

Romain L 268 Aug 18, 2022
Easy Map Annotation Clustering 📍

Cluster is an easy map annotation clustering library. This repository uses an efficient method (QuadTree) to aggregate pins into a cluster. Features R

Lasha Efremidze 1.2k Dec 25, 2022
A Swift package for parsing Clang module map files

Clangler is a Swift package used to parse Clang module map files into an abstract syntax tree (AST) representation. Once parsed, you can inspect or manipulate the nodes in the file, then generate and save a new file reflecting your changes.

Dalton Claybrook 9 Apr 7, 2022
MKMapView wrapper for SwiftUI as drop-in to MapKit's SwiftUI view

MKMapView wrapper for SwiftUI as drop-in to MapKit's SwiftUI view. Easily extensible annotations and overlays, iOS 13 support and backwards compatible with MKAnnotation and MKOverlay!

Paul 73 Dec 26, 2022
MapKit, but for SwiftUI

MapKit, but for SwiftUI

Lawrence Bensaid 2 Jul 1, 2022
Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL

Mapbox GL Native A C++ library that powers customizable vector maps in native applications on multiple platforms by taking stylesheets that conform to

Mapbox 4.2k Jan 9, 2023
Location, motion, and activity recording framework for iOS

LocoKit A Machine Learning based location recording and activity detection framework for iOS. Location and Motion Recording Combined, simplified Core

Matt Greenfield 1.5k Jan 2, 2023
A Swift wrapper for forward and reverse geocoding of OpenStreetMap data

Nominatim NominatimKit is a Swift wrapper for forward and reverse geocoding of OpenStreetMap data. Why? Geocoding location data on iOS requires the us

Josef Moser 53 Feb 5, 2022
A spatial analysis library written in Swift for native iOS, macOS, tvOS, watchOS, and Linux applications, ported from Turf.js.

Turf for Swift ?? ?? ?? ?? ⌚️ A spatial analysis library written in Swift for native iOS, macOS, tvOS, watchOS, and Linux applications, ported from Tu

Mapbox 187 Dec 19, 2022