Register Login

Talwrn Technology Blog

The iPhone MKMapView doesn’t include driving directions as far as I’m aware, but the default map app does. So what do you do when you want driving directions in your own app? The answer is pretty simple and works on v3 and v4. All you need to do is construct a Url for google maps and pass it to the map app:

UIButton btnDirections = UIButton.FromType(UIButtonType.RoundedRect); btnDirections.Frame = new System.Drawing.RectangleF(160, 320, 150, 40); btnDirections.SetTitle("Directions...", UIControlState.Normal); btnDirections.TitleLabel.TextAlignment = UITextAlignment.Center; double slat = (double)appDelegate.myLocation.Coordinate.Latitude; double slng = (double)appDelegate.myLocation.Coordinate.Longitude; string saddr = slat.ToString() + "," + slng.ToString(); string daddr = _fishery.FisheryLat.ToString() + "," + _fishery.FisheryLng.ToString(); btnDirections.TouchDown...

Read More »



You must be logged in and have permission to create or edit a blog.

Blog Archive

Home · iPhone and Android Apps · Blog · Contact
Terms Of Use  ·  Privacy Statement  ·  Copyright 2013 by Talwrn Technology