Last active
August 29, 2015 14:14
-
-
Save mollietaylor/883c6cf2836f25a82f07 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// | |
// Use this file to import your target's public headers that you would like to expose to Swift. | |
// | |
#import <UIKit/UIKit.h> | |
#import "Mapbox.h" |
This file contains hidden or 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
// | |
// ViewController.swift | |
// Mapbox Marker Image | |
// | |
// Created by Mollie on 1/29/15. | |
// | |
import UIKit | |
class ViewController: UIViewController, RMMapViewDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
RMConfiguration().accessToken = "your-api-token" | |
var mapFrame = CGRectMake(0, 20, view.bounds.width, view.bounds.height) | |
var mapTiles = RMMapboxSource(mapID: "your-map-id") | |
var mapView = RMMapView(frame: mapFrame, andTilesource: mapTiles) | |
mapView.delegate = self | |
mapView.zoom = 10 | |
mapView.centerCoordinate = CLLocationCoordinate2DMake(33.75, -84.39) | |
var location:CLLocationCoordinate2D = CLLocationCoordinate2DMake(33.78,-84.41) | |
var annotation = RMAnnotation(mapView: mapView, coordinate: location, andTitle: "Proximity Viz LLC") | |
annotation.subtitle = "Maps & Apps" | |
annotation.userInfo = "company" | |
mapView.addAnnotation(annotation) | |
view.addSubview(mapView) | |
} | |
func mapView(mapView: RMMapView!, layerForAnnotation annotation: RMAnnotation!) -> RMMapLayer! { | |
var marker: RMMarker = RMMarker(UIImage: UIImage(named: "proximity")) | |
marker.canShowCallout = true | |
return marker | |
// var parkMarker: RMMarker = RMMarker(UIImage: UIImage(named: "park")) | |
// parkMarker.canShowCallout = true | |
// | |
// if(annotation.userInfo as NSString == "park"){ | |
// return parkMarker | |
// } else { | |
// return marker | |
// } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment