0

I have a button. When touch up inside it should open Apple Maps for users to navigate to their destination (passed lat long).

The code posted several months ago no longer seems to be valid:

var mapLocationUrl = 'maps.apple.com/?ll=51.84,-8.30';
var ref = window.open(encodeURI(mapLocationUrl), '_system', 'location=no');

Open Apple Maps by passing latitude and longitude

Community
  • 1
  • 1
Onichan
  • 4,476
  • 6
  • 31
  • 60

1 Answers1

0

The current technique is to make an MKMapItem and call openInMapsWithLaunchOptions. The MKMapItem can be made from an MKPlacemark describing the location to be shown.

matt
  • 515,959
  • 87
  • 875
  • 1,141