diff --git a/src/components/Layout/Footer.tsx b/src/components/Layout/Footer.tsx index 4021e0a..c803673 100644 --- a/src/components/Layout/Footer.tsx +++ b/src/components/Layout/Footer.tsx @@ -13,6 +13,7 @@ export default function Footer() { // Desktop falls back to AMap's web search. On phones use the operating system's // map-navigation scheme so the user's installed/default map app handles the route. const amapLink = `https://uri.amap.com/search?keyword=${encodeURIComponent(address)}&city=${encodeURIComponent('成都')}&view=map&src=ameiba` + const appleMapsLink = `https://maps.apple.com/?daddr=${encodeURIComponent(address)}&dirflg=d` const openNavigation = (event: MouseEvent) => { const ua = window.navigator.userAgent const destination = encodeURIComponent(address) @@ -21,7 +22,9 @@ export default function Footer() { window.location.href = `geo:0,0?q=${destination}` } else if (/iPhone|iPad|iPod/i.test(ua)) { event.preventDefault() - window.location.href = `maps://?q=${destination}` + // Apple Maps Link is an HTTPS URL, which Safari and most iOS webviews + // handle more reliably than the blocked custom `maps://` scheme. + window.location.href = appleMapsLink } } return (