0001 // 0002 // PeliasReverseGeoConfig.swift 0003 // pelias-ios-sdk 0004 // 0005 // Created by Matt Smollinger on 1/27/16. 0006 // Copyright © 2016 Mapzen. All rights reserved. 0007 // 0008 0009 import Foundation 0010 0011 public struct PeliasReverseConfig: ReverseAPIConfigData { 0012 var urlEndpoint = NSURL.init(string: "/v1/reverse", relativeToURL: PeliasSearchManager.sharedInstance.baseUrl)! 0013 0014 var apiKey
PeliasSearchManager.swift:33 public func reverseGeocode(config: PeliasReverseConfig) -> PeliasOperation {: String? { 0015 didSet { 0016 if let key = apiKey where apiKey?.isEmpty == false { 0017 appendQueryItem("api_key", value: key) 0018 } 0019 } 0020 } 0021 0022 var queryItems = [String:NSURLQueryItem]() 0023 0024 var completionHandler
PeliasReverseGeoConfig.swift:16 if let key = apiKey where apiKey?.isEmpty == false {PeliasReverseGeoConfig.swift:16 if let key = apiKey where apiKey?.isEmpty == false {PeliasReverseGeoConfig.swift:69 apiKey = PeliasSearchManager.sharedInstance.apiKeyPeliasReverseGeoConfig.swift:74 appendQueryItem("api_key", value: apiKey): (PeliasResponse) -> Void 0025 0026 var point
PeliasReverseGeoConfig.swift:68 self.completionHandler = completionHandler: GeoPoint { 0027 didSet { 0028 appendQueryItem("point.lat", value: String(point.latitude)) 0029 appendQueryItem("point.lon", value: String(point.longitude)) 0030 } 0031 } 0032 0033 //Optional Query Params 0034 0035 var numberOfResults
PeliasReverseGeoConfig.swift:28 appendQueryItem("point.lat", value: String(point.latitude))PeliasReverseGeoConfig.swift:29 appendQueryItem("point.lon", value: String(point.longitude))PeliasReverseGeoConfig.swift:67 self.point = point: Int? { 0036 didSet { 0037 if let size = numberOfResults where numberOfResults > 0 { 0038 appendQueryItem("size", value: String(size)) 0039 } 0040 } 0041 } 0042 0043 var boundaryCountry
PeliasReverseGeoConfig.swift:37 if let size = numberOfResults where numberOfResults > 0 {PeliasReverseGeoConfig.swift:37 if let size = numberOfResults where numberOfResults > 0 {: String? { 0044 didSet { 0045 if let country = boundaryCountry where boundaryCountry?.isEmpty == false{ 0046 appendQueryItem("boundary.country", value: country) 0047 } 0048 } 0049 } 0050 0051 var dataSources
PeliasReverseGeoConfig.swift:45 if let country = boundaryCountry where boundaryCountry?.isEmpty == false{PeliasReverseGeoConfig.swift:45 if let country = boundaryCountry where boundaryCountry?.isEmpty == false{: [SearchSource]? { 0052 didSet { 0053 if let sources = dataSources where dataSources?.isEmpty == false { 0054 appendQueryItem("sources", value: SearchSource.dataSourceString(sources)) 0055 } 0056 } 0057 } 0058 0059 var layers
PeliasReverseGeoConfig.swift:53 if let sources = dataSources where dataSources?.isEmpty == false {PeliasReverseGeoConfig.swift:53 if let sources = dataSources where dataSources?.isEmpty == false {: [LayerFilter]? { 0060 didSet { 0061 if let layerArray = layers where layers?.isEmpty == false { 0062 appendQueryItem("layers", value: LayerFilter.layerString(layerArray)) 0063 } 0064 } 0065 } 0066 init(point: GeoPoint, completionHandler: (PeliasResponse) -> Void){ 0067 self.point = point 0068 self.completionHandler = completionHandler 0069 apiKey = PeliasSearchManager.sharedInstance.apiKey 0070 defer { 0071 //didSet will not fire because self is not setup so we have to do this manually 0072 appendQueryItem("point.lat", value: String(point.latitude)) 0073 appendQueryItem("point.lon", value: String(point.longitude)) 0074 appendQueryItem("api_key", value: apiKey) 0075 } 0076 } 0077 } 0078
PeliasReverseGeoConfig.swift:61 if let layerArray = layers where layers?.isEmpty == false {PeliasReverseGeoConfig.swift:61 if let layerArray = layers where layers?.isEmpty == false {