In addition to the answers given, if you had an address string rather than lat-longs, you would use for iOS:
function launchDirections(address) {
window.location.href = "maps://maps.apple.com/?daddr=" + address;
}
where address
would be a string like: "24 Spring Street, New York, NY"