new NearPoiSearch(context, optionsopt)
BeNomad BeMap JavaScript API - NearPoiSearch (v1.5)
Promise-based wrapper around `POST service/nearpoi/1.0`. Returns the POIs
reachable from a coordinate within a distance budget.
Wire shape mirrors the BeMap server contract (cross-checked against
`bemap-flutter-api/lib/service/near_poi/provider/near_poi.dart`).
Typical use:
var search = new bemap.NearPoiSearch(ctx);
search.nearPoi(new bemap.NearPoiRequest({
coordinate: new bemap.Coordinate(2.3522, 48.8566),
distance: 800,
transportType: bemap.TransportMode.CAR,
orderBy: bemap.NearPoiOrder.DISTANCE_ASC
})).then(function(response) {
response.getPoints().forEach(function(p) { ... });
});
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
context |
bemap.Context | BeMap-JS-API Context. Mandatory. | |
options |
Object |
<optional> |
- Since:
- 1.5.0
- Source:
Extends
- bemap.ServiceV2
Methods
nearPoi(arg, filtersopt, optionsopt) → {Promise.<bemap.NearPoiResponse>}
Send a near-POI request.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg |
bemap.NearPoiRequest | bemap.Coordinate | bemap.CoordinateSat | - A typed `NearPoiRequest` (preferred). - Or a bare coordinate; in that case the second argument carries `{ distance, transportType, orderBy, enablePolyline, enableEncodedPolyline }`. | |||||||||||||
filters |
Object |
<optional> |
Filter shorthand when the first arg is a bare coordinate. | ||||||||||||
options |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<bemap.NearPoiResponse>