--- title: ASMapNode layout: docs permalink: /docs/map-node.html prevPage: video-node.html nextPage: control-node.html --- `ASMapNode` allows you to easily specify a geographic region to show to your users. ### Basic Usage Let's say you'd like to show a snapshot of San Francisco. All you need are the coordinates.
ASMapNode *mapNode = [[ASMapNode alloc] init];
mapNode.style.preferredSize = CGSizeMake(300.0, 300.0);
// San Francisco
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(37.7749, -122.4194);
// show 20,000 square meters
mapNode.region = MKCoordinateRegionMakeWithDistance(coord, 20000, 20000);
MKMapCamera
: used to configure altitude and pitch of the cameraMKMapRect
: basically a CGRectMKMapRegion
: Controls the coordinate of focus, and the size around that focus to showMKMapType
: Can be set to Standard, Satellite, etc.
MKMapSnapshotOptions *options = [[MKMapSnapshotOptions alloc] init];
options.mapType = MKMapTypeSatellite;
options.region = MKCoordinateRegionMakeWithDistance(coord, 20000, 20000);
mapNode.options = options;
MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
annotation.coordinate = CLLocationCoordinate2DMake(37.7749, -122.4194);
mapNode.annotations = @[annotation];
mapNode.liveMap = YES;