Class MapIconFromOsmFactory

This class is used to create an svg icon for a route note

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 43

Constructor

new MapIconFromOsmFactory ( )

The constructor

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 214

Public methods

async getIconAndAdressAsync ( iconLatLng, route )

Get the svg and the data needed for creating the icon, using an async function

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 235

Parameters

Name Type Description
iconLatLng Array of Number

The latitude and longitude of the icon

route Route

The route to witch the icon will be attached.

Returns

An object with the note data
Type : null or NoteDataForMapIcon

getIconAndAdressWithPromise ( mapIconData )

Get the svg and the data needed for creating the icon, using a promise

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 249

Parameters

Name Type Description
mapIconData MapIconData

An object with the latLng of the note and a reference to the Route for witch the icon is build

Returns

A Promise fullfilled with the svg data
Type : Promise

Private properties

#computeData : ComputeDataForMapIcon

The ComputeData object needed to buid the note

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 57

#noteData : NoteDataForMapIcon

The NoteDataForMapIcon object needed to buid the note

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 50

#overpassAPIDataLoader : OverpassAPIDataLoader

An OverpassAPIDataLoader object used to search the osm data

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 64

#queryDistance : Number

The distance used to search cities and hamlet in osm

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 71

#requestStarted : Boolean

A guard to avoid to mutch requests at the same time

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 78

Private getters and setters

readonly static get #SEARCH_AROUND_FACTOR : Number

A constant used for searching the OSM data

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 86

Private methods

#buildIconAndAdress ( )

Search and build all the needed data

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 120

async #exeGetIconAndAdress ( )

Start the buid of the note data

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 138

async #exeGetIconAndAdressWithPromise ( onOk, onError )

The method used to buid the icon with a Promise

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 199

Parameters

Name Type Description
onOk Function

The onOk handler of the Promise

onError Function

The onError handler of the Promise

#searchNearestItineraryPoint ( )

This method search the nearest itinerary point from the point given by the user

Source : file core/mapIcon/MapIconFromOsmFactory.js at line 92