Class OverpassAPIDataLoader

This class is used to search osm data with the OverpassAPI

Source : file core/lib/OverpassAPIDataLoader.js at line 36

Constructor

new OverpassAPIDataLoader ( options )

The constructor

Source : file core/lib/OverpassAPIDataLoader.js at line 303

Parameters

Name Type Description
options OverpassAPIDataLoaderOptions

An object with the options to set

Public getters and setters

readonly get city : String

The osm city

Source : file core/lib/OverpassAPIDataLoader.js at line 415

readonly get country : String

The osm country

Source : file core/lib/OverpassAPIDataLoader.js at line 422

readonly get nodes : Map

A map with the osm nodes

Source : file core/lib/OverpassAPIDataLoader.js at line 387

readonly get place : String

The osm place ( hamlet or village )

Source : file core/lib/OverpassAPIDataLoader.js at line 408

readonly get relations : Map

A map with the osm relations

Source : file core/lib/OverpassAPIDataLoader.js at line 401

readonly get statusOk : Boolean

The final status

Source : file core/lib/OverpassAPIDataLoader.js at line 429

readonly get ways : Map

A map with the osm ways

Source : file core/lib/OverpassAPIDataLoader.js at line 394

Public methods

async loadData ( queries, latLng )

This method launch the queries in the OverpassAPI and parse the received data

Source : file core/lib/OverpassAPIDataLoader.js at line 324

Parameters

Name Type Description
queries Array of String

An array of queries to be executed in the OverpassAPI

latLng Array of Number

The latitude and longitude used in the queries

Private properties

#adminNames : Array of String

A list with the administrative names found by the API

Source : file core/lib/OverpassAPIDataLoader.js at line 71

#city : null or String

The city name found in the OSM data

Source : file core/lib/OverpassAPIDataLoader.js at line 107

#latLng : Array of Number

A reference to the latitude and longitude used in the queries

Source : file core/lib/OverpassAPIDataLoader.js at line 93

#nodes : Map of OsmElement

A map with the osm nodes found by the API, ordered by id

Source : file core/lib/OverpassAPIDataLoader.js at line 50

#options : OverpassAPIDataLoaderOptions

The options for the OverpassAPIDataLoader

Source : file core/lib/OverpassAPIDataLoader.js at line 43

#osmCityAdminLevel : Number

The Admin level at witch the cities are placed in OSM (Is country dependant...)

Source : file core/lib/OverpassAPIDataLoader.js at line 78

#place : null or String

A hamlet, village, city or town name found in the OSM data

Source : file core/lib/OverpassAPIDataLoader.js at line 100

#places : Object

An Object with hamlet, village, city and town properties. Each properties are objects with name, distance and maxDistance properties.

Source : file core/lib/OverpassAPIDataLoader.js at line 86

#relations : Map of OsmElement

A map with the osm relations found by the API, ordered by id

Source : file core/lib/OverpassAPIDataLoader.js at line 64

#statusOk : Boolean

A flag indicating the success or failure of the request

Source : file core/lib/OverpassAPIDataLoader.js at line 114

#ways : Map of OsmElement

A map with the osm ways found by the API, ordered by id

Source : file core/lib/OverpassAPIDataLoader.js at line 57

Private methods

#parseData ( osmElements )

This method parse the osm elements received from the OverpassAPI

Source : file core/lib/OverpassAPIDataLoader.js at line 172

Parameters

Name Type Description
osmElements Array of Object

The osm elements received in the request.

async #parseSearchResults ( results )

This method parse the responses from the OverpassAPI

Source : file core/lib/OverpassAPIDataLoader.js at line 278

Parameters

Name Type Description
results Array of Object

The results received from fetch

#setGeometry ( )

This method add the geometry to the osm elements

Source : file core/lib/OverpassAPIDataLoader.js at line 120

#setPlaceAndCity ( )

This method search the city and place name from the osm elements

Source : file core/lib/OverpassAPIDataLoader.js at line 243