Class: Pois

cercalia.service.Pois

new cercalia.service.Pois(options)

POIs service constructor.

Use this class for getting POIs specifying the IDs, or getting a POI list from an area (WKT or map bounds (cercalia.Bounds)) and the POI category

Name Type Description
options

Opciones Geocoding

Name Type Description
bounds cercalia.Bounds | undefined optional

Bounds to search categories inside

buffer number | undefined optional
categories Array.<string> | undefined optional

List of categories to obtain. The 'pois' option must be null.

gridsize string | undefined optional
height number | undefined optional

Height in píxels.

pois Array.<string> | undefined optional

POIs IDs list to obtain. If this option is included, the categories property will be ignored. Does not apply any other constructor options.

searchByScale Boolean | undefined optional

Specify if you need to group POIs depending on parameters: bounds, width and height.

width number | undefined optional

Width, in píxels.

wkt string | undefined optional

Get all the POIs from selected categories, that intersects a polygon, in WKT format

Methods

Abort the last AJAX request if it hasn't been resolved.

Execute the server request and the callback function to be processed with the response

Name Type Description
callbackFn function

Funcion callback

Returns the WKT of the spatial query

Returns:
Coordinate

Returns the object type.

Returns:
gridsize
Returns:
height

getQueryCategories(){Array.<string>}

Returns the POIs categories to search

Returns:
categories list string

getQueryPois(){Array.<string>}

Returns the POIs list

Returns:
Returns a POI IDs array

Returns the response with the 'geocode' function request

Returns:
response
Returns:
width

Returns the map area corresponding to the spatial query. The format is WKT

Returns:
Geometria WKT (string)
Returns:
boolean that shows if POIs by scale search is used

Set the polygon for the spatial query. String WKT format. If spatial query use map bounds, the WKT will be ignored and must be reset next time

Name Type Description
wkt cercalia.LonLat

WKT string

Name Type Description
gridsize number
Name Type Description
height number

Set the POIs list to search.

Name Type Description
pois Array.<string>

POIs ID list, in an array

Set the POIs categories to search.

Name Type Description
categories Array.<string>

categories list string

setSearchbyScale(searchByScale)

Name Type Description
searchByScale boolean
Name Type Description
width number

Set the polygon for the spatial query. String WKT format If spatial query use a WKT, the map bounds will be ignored and must be reset next time

Name Type Description
wkt Array.<string>

WKT geometry