Skip to content

Instantly share code, notes, and snippets.

@GuyCarver
Last active September 23, 2016 07:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GuyCarver/d84eddd1fb2740aa833595ea174fbed2 to your computer and use it in GitHub Desktop.
Save GuyCarver/d84eddd1fb2740aa833595ea174fbed2 to your computer and use it in GitHub Desktop.
F# version of map.cs example for Continuous app
//
// 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