Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    SVS Engineers: Who are the people that test-drive your network?

    October 12, 2025

    macOS Sequoia (version 15) is now available for your Mac with some big upgrades

    October 12, 2025

    Building a real-time ICU patient analytics pipeline with AWS Lambda event source mapping

    October 12, 2025
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»ios – Apple mapkit route function dose not works in China
    iOS Development

    ios – Apple mapkit route function dose not works in China

    big tee tech hubBy big tee tech hubOctober 12, 2025032 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    ios – Apple mapkit route function dose not works in China
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I’m developing an iOS app using MapKit to calculate travel times between two coordinates.
    Everything works perfectly when I test with coordinates in the US, Japan, or Hong Kong if my network is outside mainland China.

    However, when my device (or simulator) is connected to a mainland China network and always fails with: “Directions Not Available“

    Some test result:
    Hong Kong → Hong Kong: ✅ works

    Hong Kong → Shanghai: ✅ works

    Shanghai → Hong Kong: ✅ works

    Japan (Tokyo → Tokyo): ❌ fail

    US (New York → New York): ❌ fail

    struct TravelTimeCalculator {
        static func calculateTravelTime(
            from: CLLocationCoordinate2D,
            to: CLLocationCoordinate2D
        ) async throws -> TimeInterval {
            let sourcePlacemark = MKPlacemark(coordinate: from)
            let destPlacemark = MKPlacemark(coordinate: to)
    
            let request = MKDirections.Request()
            request.source = MKMapItem(placemark: sourcePlacemark)
            request.destination = MKMapItem(placemark: destPlacemark)
            request.transportType = .automobile
    
            let directions = MKDirections(request: request)
            let response = try await directions.calculate()
            guard let route = response.routes.first else {
                throw NSError(domain: "No route found", code: -1)
            }
            return route.expectedTravelTime
        }
    }
    
    @MainActor
    struct TravelTimeView: View {
        @State private var travelTime: String = "Calculating..."
    
        var body: some View {
            VStack {
                Text(travelTime)
                    .font(.title2)
            }
            .task {
                do {
                    // Example: Tokyo Station → Shibuya Station
                    let from = CLLocationCoordinate2D(latitude: 35.6811441, longitude: 139.7644865)
                    let to   = CLLocationCoordinate2D(latitude: 35.6580382, longitude: 139.6990609)
                    
                    let seconds = try await TravelTimeCalculator.calculateTravelTime(from: from, to: to)
                    let minutes = Int(seconds / 60)
                    travelTime = "🚗 Estimated \(minutes) min"
                } catch {
                    travelTime = "❌ Route not available"
                    print("Route error: \(error.localizedDescription)")
                }
            }
        }
    }
    

    Test all kind of source / dest combination…



    Source link

    Apple China dose function iOS MapKit route works
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    Apple says goodbye to the Clips app

    October 12, 2025

    swift – Does UIDevice.current.identifierForVendor change after iCloud backup and restore on another iOS device?

    October 11, 2025

    October 10, 2025 – Vision Pro live sports, Apple exec changes

    October 11, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    SVS Engineers: Who are the people that test-drive your network?

    October 12, 2025

    macOS Sequoia (version 15) is now available for your Mac with some big upgrades

    October 12, 2025

    Building a real-time ICU patient analytics pipeline with AWS Lambda event source mapping

    October 12, 2025

    The Download: Our bodies’ memories, and Traton’s electric trucks

    October 12, 2025
    Advertisement
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    SVS Engineers: Who are the people that test-drive your network?

    October 12, 2025

    macOS Sequoia (version 15) is now available for your Mac with some big upgrades

    October 12, 2025

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2025 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.