HomeiOS Developmentios - Swift Recreate Apple Maps UI

ios – Swift Recreate Apple Maps UI


Whats up Id wish to create the same interactive globe to Apples Apple Maps. I would really like the map kind to be .commonplace but be capable of absolutely zoom out and present the total globe. Id additionally wish to mimic apples app map UI as a lot as attainable. If anybody is aware of of any libraries that already do that Id admire the enter.

At present when I’ve the map kind to .commonplace, I can’t absolutely zoom out. The absolutely zoomed out globe is barely obtainable within the fly over sorts, however these sorts present the globe utilizing satellite tv for pc photos (exhibits all terrain). Id like to have the ability to have a typical theme however be capable of zoom out absolutely. Id admire any assist as I’m not expert with mapkit.

import UIKit
import SwiftUI
import MapKit

struct MapViewSec: UIViewRepresentable {
    
    func makeUIView(context: Context) -> MKMapView {
        let mapView = MKMapView()
        mapView.mapType = .satellite tv for pc
        mapView.showsScale = true
        mapView.isRotateEnabled = true

        let initialCoordinate = CLLocationCoordinate2D(latitude: 37.7749, longitude: -122.4194)
        let digital camera = MKMapCamera(lookingAtCenter: initialCoordinate, fromEyeCoordinate: initialCoordinate, eyeAltitude: 1000000000000000000)
        mapView.setCamera(digital camera, animated: false)
        

        
        return mapView
    }

    func updateUIView(_ uiView: MKMapView, context: Context) {
        // You'll be able to implement replace logic right here if wanted
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments