Home Manual Reference Source
public class | source

GeoResourceProxy

Extends:

SimpleResourceProxyResourceProxy → GeoResourceProxy

Constructor Summary

Public Constructor
public

constructor(api: Maps4News, Target: ResourceBase, altUrl: string, seedData: object, options: object)

Member Summary

Public Members
public get

If the proxy supports for-point operations

public get

If the proxy supports for-point operations

Method Summary

Public Methods
public

async forBoundary(boundary: Object, limit: Number): Promise<ResourceBase[]>

Get an array of results for boundary

public

async forPoint(point: Object, limit: Number): Promise<ResourceBase[]>

Get an array of results for point

Inherited Summary

From class SimpleResourceProxy
public get

Target to wrap results in

public get

Get api instance

public get

Proxy target url

public

List target resource

public
this method was deprecated.

List target resource

public

Get the resource lister

public

Build a new instance of the target

From class ResourceProxy
public

async get(id: Number | String | Object, deleted: String): Promise<ResourceBase>

Get target resource

public

Select target resource without obtaining data

Public Constructors

public constructor(api: Maps4News, Target: ResourceBase, altUrl: string, seedData: object, options: object) source

Override:

ResourceProxy#constructor

Params:

NameTypeAttributeDescription
api Maps4News

Instance of the api

Target ResourceBase

Target to wrap

altUrl string
  • optional
  • default: null
  • nullable: true

Internal use, Optional alternative url for more complex routing

seedData object

Internal use, used for seeding ::new

options object

instance options

options.hasForPoint boolean
  • optional
  • default: true

If the endpoint supports for-point

options.hasForBoundary boolean
  • optional
  • default: true

If the endpoint supports for-boundary

Public Members

public get hasForBoundary: boolean: * source

If the proxy supports for-point operations

Return:

boolean

If it supports the operations

public get hasForPoint: boolean: * source

If the proxy supports for-point operations

Return:

boolean

If it supports the operations

Public Methods

public async forBoundary(boundary: Object, limit: Number): Promise<ResourceBase[]> source

Get an array of results for boundary

Params:

NameTypeAttributeDescription
boundary Object

boundary to search within

boundary.topLeft Object

top left corner of the boundary

boundary.topLeft.lat Number

top left corner latitude

boundary.topLeft.lng Number

top left corner longitude

boundary.bottomRight Object

bottom right corner of the boundary

boundary.bottomRight.lat Number

bottom right corner latitude

boundary.bottomRight.lng Number

bottom right corner longitude

limit Number

maximum amount of results, can't be larger then RequestParameters.maxPerPage

Return:

Promise<ResourceBase[]>

target resource for boundary

Throw:

*

TypeError

*

GeoError

public async forPoint(point: Object, limit: Number): Promise<ResourceBase[]> source

Get an array of results for point

Params:

NameTypeAttributeDescription
point Object

point to search at

point.lat Number

top left corner latitude

point.lng Number

top left corner longitude

limit Number

maximum amount of results, can't be larger then RequestParameters.maxPerPage

Return:

Promise<ResourceBase[]>

target resource for boundary

Throw:

*

TypeError

*

GeoError