<commit_before>//
//  MapViewController.swift
//  ios-sdk
//
//  Created by <NAME> on 11/21/16.
//  Copyright © 2016 Mapzen. All rights reserved.
//


import UIKit
import TangramMap
import CoreLocation
import Pelias
import OnTheRoad

@objc public enum MZError: Int {
  case generalError, annotationDoesNotExist, apiKeyNotSet, routeDoesNotExist
}

@objc public protocol MapGestureDelegate : NSObjectProtocol {
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeSingleTapGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeSingleTapGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeDoubleTapGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeDoubleTapGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeLongPressGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeLongPressGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizePanGesture displacement: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizePanGesture displacement: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizePinchGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizePinchGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeRotationGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeRotationGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeShoveGesture displacement: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeShoveGesture displacement: CGPoint)
}

@objc public protocol MapLoadDelegate : NSObjectProtocol {
  @objc optional func mapView(_ controller: MapViewController, didLoadSceneAsync scene: String)
  @objc optional func mapViewDidCompleteLoading(_ mapView: MapViewController)
}

@objc public protocol MapSelectDelegate : NSObjectProtocol {
  @objc optional func mapView(_ mapView: MapViewController, didSelectFeature feature: [AnyHashable : Any]?, atScreenPosition position: CGPoint)
  @objc optional func mapView(_ mapView: MapViewController, didSelectLabel labelPickResult: TGLabelPickResult?, atScreenPosition position: CGPoint)
  @objc optional func mapView(_ mapView: MapViewController, didSelectMarker markerPickResult: TGMarkerPickResult?, atScreenPosition position: CGPoint)
}

open class MapViewController: UIViewController, LocationManagerDelegate, TGRecognizerDelegate {

  //Error Domains for NSError Appeasement
  open static let MapzenGeneralErrorDomain = "MapzenGeneralErrorDomain"

  open var tgViewController: TGMapViewController = TGMapViewController()
  var currentLocationGem: TGMapMarkerId?
  var lastSetPoint: TGGeoPoint?
  var shouldShowCurrentLocation = false
  var currentRouteMarker: TGMapMarkerId?<commit_msg>Rm TGRecognizerDelegate from MapViewController declaration<commit_after>//
//  MapViewController.swift
//  ios-sdk
//
//  Created by <NAME> on 11/21/16.
//  Copyright © 2016 Mapzen. All rights reserved.
//


import UIKit
import TangramMap
import CoreLocation
import Pelias
import OnTheRoad

@objc public enum MZError: Int {
  case generalError, annotationDoesNotExist, apiKeyNotSet, routeDoesNotExist
}

@objc public protocol MapGestureDelegate : NSObjectProtocol {
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeSingleTapGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeSingleTapGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeDoubleTapGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeDoubleTapGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeLongPressGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeLongPressGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizePanGesture displacement: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizePanGesture displacement: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizePinchGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizePinchGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeRotationGesture location: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeRotationGesture location: CGPoint)
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, shouldRecognizeShoveGesture displacement: CGPoint) -> Bool
  @objc optional func mapView(_ view: MapViewController, recognizer: UIGestureRecognizer, didRecognizeShoveGesture displacement: CGPoint)
}

@objc public protocol MapLoadDelegate : NSObjectProtocol {
  @objc optional func mapView(_ controller: MapViewController, didLoadSceneAsync scene: String)
  @objc optional func mapViewDidCompleteLoading(_ mapView: MapViewController)
}

@objc public protocol MapSelectDelegate : NSObjectProtocol {
  @objc optional func mapView(_ mapView: MapViewController, didSelectFeature feature: [AnyHashable : Any]?, atScreenPosition position: CGPoint)
  @objc optional func mapView(_ mapView: MapViewController, didSelectLabel labelPickResult: TGLabelPickResult?, atScreenPosition position: CGPoint)
  @objc optional func mapView(_ mapView: MapViewController, didSelectMarker markerPickResult: TGMarkerPickResult?, atScreenPosition position: CGPoint)
}

open class MapViewController: UIViewController, LocationManagerDelegate {

  //Error Domains for NSError Appeasement
  open static let MapzenGeneralErrorDomain = "MapzenGeneralErrorDomain"

  open var tgViewController: TGMapViewController = TGMapViewController()
  var currentLocationGem: TGMapMarkerId?
  var lastSetPoint: TGGeoPoint?
  var shouldShowCurrentLocation = false
  var currentRouteMarker: TGMapMarkerId?
{'fraction_non_alphanumeric': 0.0641007891457843, 'fraction_numerical': 0.0027689325764917623, 'mean_word_length': 7.539007092198582, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '93405', 'n_tokens_mistral': 2180, 'n_tokens_neox': 1930, 'n_words': 594}