32 lines
761 B
JavaScript
32 lines
761 B
JavaScript
import { Feature } from "../types/Feature";
|
|
export class Geo extends Feature {
|
|
cache;
|
|
constructor(cache) {
|
|
super();
|
|
this.cache = cache;
|
|
}
|
|
async searchPoi(name, areaId, typeCode, indexFrom, count) {
|
|
const { result } = await this.cache.exec('geoService', {
|
|
api: 'geo',
|
|
params: {
|
|
name,
|
|
areaId,
|
|
indexFrom,
|
|
count,
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
;
|
|
async regeo(longitude, latitude) {
|
|
const { result } = await this.cache.exec('geoService', {
|
|
api: 'regeo',
|
|
params: {
|
|
longitude,
|
|
latitude,
|
|
},
|
|
});
|
|
return result;
|
|
}
|
|
}
|