Last active
September 23, 2016 07:41
-
-
Save GuyCarver/d84eddd1fb2740aa833595ea174fbed2 to your computer and use it in GitHub Desktop.
F# version of map.cs example for Continuous app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Map Example for Continuous | |
// | |
// Displays a point on a map | |
// | |
// Experiments: | |
// 1. Change the coordinate to your home | |
// 2. Add more pins | |
// 3. Change the map type to a satellite view | |
// | |
open System | |
open UIKit | |
open CoreGraphics | |
open CoreLocation | |
open MapKit | |
// Create a view that displays the map | |
let mapView = new MKMapView(CGRect(0.0, 0.0, 320.0, 320.0)) | |
// Note a 2D coordinate to display | |
let coord = CLLocationCoordinate2D(38.8893, -77.0502) | |
// Place a pin at the coordinate | |
let pin = new MKPointAnnotation() | |
pin.Coordinate <- coord | |
mapView.AddAnnotations pin | |
// Center the map | |
mapView.SetRegion (MKCoordinateRegion.FromDistance(coord, 2000.0, 2000.0), false) | |
// Display | |
let v = new UIView() | |
let Main = mapView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment