HereSDKMapService
@interface HereSDKMapService : NSObject
The HereSDKMapService class provides services for route & geocoding queries.
-
Requests routes that meet the constraints in the HereSDKRouteRequest object.
Declaration
Objective-C
- (void)getRoutesWithRequest:(nonnull HereSDKRouteRequest *)routeRequest andHandler: (nonnull void (^)(NSArray<HereSDKRoute *> *_Nullable, NSError *_Nullable))handler;
Swift
func getRoutesWith(_ routeRequest: HereSDKRouteRequest, andHandler handler: @escaping ([HereSDKRoute]?, Error?) -> Void)
Parameters
routeRequest
Route constraints that the results must comply with
handler
Block for handling route results
-
Submits a reverse-geocoding request (coordinates to place names) for the specified location.
Declaration
Objective-C
- (void)reverseGeocodeLocation:(nonnull CLLocation *)location andHandler:(nonnull HereSDKGeocodeCompletionHandler)handler;
Swift
func reverseGeocodeLocation(_ location: CLLocation, andHandler handler: @escaping HereSDKGeocodeCompletionHandler)
Parameters
location
Location coordinates to reverse-geocode
handler
Block for handling reverse-geocoding results
-
Submits a forward-geocoding request (place name to coordinates) for the specified location and query.
Declaration
Objective-C
- (void)geocodeQuery:(nonnull NSString *)query forlocation:(nonnull CLLocation *)location andHandler:(nonnull HereSDKGeocodeCompletionHandler)handler;
Swift
func geocodeQuery(_ query: String, forlocation location: CLLocation, andHandler handler: @escaping HereSDKGeocodeCompletionHandler)
Parameters
query
String that contains the address or place name to geocode
location
Approximate location of the target location
handler
Block for handling geocoding results
-
Submits a forward-geocoding request for the specified query, location, countryCode and type (address and/or place name).
Declaration
Objective-C
- (void)geocodeQuery:(nonnull NSString *)query forlocation:(nonnull CLLocation *)location resultType:(HereSDKGeocodeResultType)resultType countryCode:(nonnull NSString *)countryCode andHandler:(nonnull HereSDKGeocodeCompletionHandler)handler;
Swift
func geocodeQuery(_ query: String, forlocation location: CLLocation, resultType: HereSDKGeocodeResultType, countryCode: String, andHandler handler: @escaping HereSDKGeocodeCompletionHandler)
Parameters
query
String that contains the address or place name to geocode
location
Approximate location of the target location
resultType
A bitmask value of the types of results that should be returned (see HereSDKGeocodeResultType.h)
countryCode
ISO 3166 Alpha 3 country code used to filter results.
handler
Block for handling geocoding results
-
Submits a forward-geocoding request for places in the area of the given location
Declaration
Objective-C
- (void)nearbyPlacesForLocation:(nonnull CLLocation *)location andHandler: (nonnull HereSDKGeocodeCompletionHandler)handler;
Swift
func nearbyPlaces(for location: CLLocation, andHandler handler: @escaping HereSDKGeocodeCompletionHandler)
Parameters
location
Location in the desired area of the results
handler
Block for handling geocoding results
-
Get detailed info about a specific address. After calling {@link geocodeQuery}, use the href field from {@link HereSDKGeocodeResult} as the addressId to retrieve the info.
Declaration
Objective-C
- (void)getAddressDataWithAddressId:(nonnull NSString *)addressId andHandler: (nonnull void (^)(int *_Nullable, NSError *_Nullable))handler;
Swift
func getAddressData(withAddressId addressId: String, andHandler handler: @escaping (UnsafeMutablePointer<Int32>?, Error?) -> Void)