Home Reference Source
public class | source

BGMapWrapper

This class represents a background map wrapper. Used to be a "middle-man" between the background map provider and the API.

Constructor Summary

Public Constructor
public

This is the map that comes from the background map provider(e.g., MapBox).

Member Summary

Public Members
public
public

This is the map that comes from the background map provider(e.g., MapBox).

Method Summary

Public Methods
public

createCanvas(id: number): HTMLCanvasElement

Given one id it creates a canvas object.

public

Auxiliar method to be called when the we want to create the loader.

public

Returns the map's containing HTML element.

public

Returns the latitude of the bounding box northwest corner.

public

Returns the longitude of the bounding box northwest corner.

public

getZoom(): *

Returns the map's current zoom level.

public

loader()

Creates loader to be shown at the beginning when the API is loading all data.

public

onEvent(eventstr: string, eventfunction: Function)

Adds a listener to a specified event type.

Public Constructors

public constructor(map: Object) source

This is the map that comes from the background map provider(e.g., MapBox).

Params:

NameTypeAttributeDescription
map Object

Public Members

public loaderDiv: * source

public map: Object source

This is the map that comes from the background map provider(e.g., MapBox).

Public Methods

public createCanvas(id: number): HTMLCanvasElement source

Given one id it creates a canvas object.

Params:

NameTypeAttributeDescription
id number

The id of the canvas to be created.

Return:

HTMLCanvasElement

Canvas object where everything will be drawn.

TODO:

  • Understand case mapbox comment bellow.

public createLoader() source

Auxiliar method to be called when the we want to create the loader.

TODO:

  • Probably it is not being used because nobody calls it(see L:82). It inserts two divs on the map

public getContainer(): * source

Returns the map's containing HTML element.

Return:

*

public getLatBound(): * source

Returns the latitude of the bounding box northwest corner.

Return:

*

public getLngBound(): * source

Returns the longitude of the bounding box northwest corner.

Return:

*

public getZoom(): * source

Returns the map's current zoom level.

Return:

*

public loader() source

Creates loader to be shown at the beginning when the API is loading all data.

TODO:

  • This method is calling another with parameters in the 1st if. This is incorrect.

public onEvent(eventstr: string, eventfunction: Function) source

Adds a listener to a specified event type.

Params:

NameTypeAttributeDescription
eventstr string

The event type to add a listen for.

eventfunction Function

The function to be called when the event is fired. The listener function is called with the data object passed to fire , extended with target and type properties.