POI Range
POI Range iOS SDK provides the ability to query all POI information within a specified area.
| Interface code | Interface | Class |
|---|---|---|
| geoPoiRange | POI range | GeoPoiResponse |
Parameters
GeoPoiRangeParameter
-
location(required)The comma-separated longitude and latitude (decimal, up to 2 decimal places) of the location to be queried. For example:location=116.41,39.92 -
type(required)Choose to search for a certain type of POI.scenicScenic SpotCSTACurrents StationTSTATide Station
-
radiusSet search radius, the value range is 1-50, in kilometers. 5 by default. -
numberNumber of the results in response, from 1 to 20, 10 is the default. -
langMulti-language setting, please see Language to find out how our multi-language works and how to set up.
Sample code
Swift
Task{
do{
let response = try await QWeather.instance
.geoPoiRange(.init(location: "113.88,22.45", type: .CSTA, radius: 50))
print(response)
} catch QWeatherError.errorResponse(let error) {
print(error)
} catch {
print(error)
}
}
Objective-C
GeoPoiRangeParameter * parameter = [GeoPoiRangeParameter instanceWithLocation:@"116.41,39.92"
type:PoiSCENIC
radius:@(50)
number:@(10)
lang:@(LangZH_HANS)];
[QWeatherObjc geoPoiRange:parameter completionHandler:^(GeoPoiResponse * _Nullable response, NSError * _Nullable error) {
if (response) {
NSLog(@"%@", response.description);
}
if (error) {
NSLog(@"%@", error.localizedDescription);
}
}];
Response
GeoPoiResponse
-
codeSee Status Code -
poi.namePOI Name -
poi.idPOI ID -
poi.latLatitude of the POI -
poi.lonLongitude of the POI -
poi.adm2Name of the superior administrative division of the POI -
poi.adm1The first-level administrative area of the POI -
poi.countryCountry name of the POI -
poi.tzPOI timezone -
poi.utcOffsetThe number of hours offset between local time and UTC time, refer to UTC Offset -
poi.isDstIs the POI currently on daylight saving time.1for daylight saving time and0for not in daylight saving time. -
poi.typePOI type -
poi.rankPOI Rank -
poi.fxLinkResponsive web page of this location, easy to embed in your website or APP -
refer.sourcesData source and other statements, may be null -
refer.licenseData license, may be null