File

src/utility/eposLeaflet/components/layers/tileLayer.ts

Extends

MapLayer

Index

Properties
Methods

Constructor

constructor(id: string, name?: string)
Parameters :
Name Type Optional
id string No
name string Yes

Properties

Public attr
Type : string
Public sd
Type : Array<string>
Public url
Type : string
Public addedToMap
Default value : new SimpleConfigObservableWithValue<this, null | boolean>(this)
Inherited from MapLayer
Defined in MapLayer:123

The above code is declaring a public property called "addedToMap" which is an instance of the "SimpleConfigObservableWithValue" class. This class is a generic class that takes two type parameters: "this" and "null | boolean". The "this" type parameter refers to the current class, while the "null | boolean" type parameter represents a value that can be either null or boolean.

Static Readonly BBOX_EDITABLE_LAYER_ID
Type : string
Default value : 'editablebbox'
Inherited from MapLayer
Defined in MapLayer:77

The above code is declaring a public static readonly variable named BBOX_EDITABLE_LAYER_ID with the value 'editablebbox'.

Static Readonly BBOX_LAYER_ID
Type : string
Default value : 'spatialbbox'
Inherited from MapLayer
Defined in MapLayer:73

The above code is declaring a public static readonly variable named BBOX_LAYER_ID with the value 'spatialbbox'.

Protected clickSource
Default value : new Subject<L.LeafletMouseEvent>()
Inherited from MapLayer
Defined in MapLayer:147

The above code is defining a protected property called "clickSource" which is an instance of the Subject class from the RxJS library. This Subject is specifically configured to emit LeafletMouseEvent objects.

Static Readonly DEFAULT_LAYER_LEGEND_LABEL
Type : []
Default value : [ { type: this.MARKERTYPE_POINT, value: 'Default Marker' }, { type: this.MARKERTYPE_POLYGON, value: 'Default Polygon' }, { type: this.MARKERTYPE_LINE, value: 'Default Line' }, ]
Inherited from MapLayer
Defined in MapLayer:86

The above code is defining a static readonly array called DEFAULT_LAYER_LEGEND_LABEL. This array contains objects with two properties: type and value. Each object represents a different type of marker (point, polygon, or line) and its corresponding label.

Protected eposLeaflet
Type : EposLeafletComponent
Inherited from MapLayer
Defined in MapLayer:163

The above code is declaring a protected variable called "eposLeaflet" of type "EposLeafletComponent".

Public hidden
Default value : new SimpleConfigObservableWithValue<this, boolean>(this, false)
Inherited from MapLayer
Defined in MapLayer:136

The above code is declaring a public property called "hidden" of type "SimpleConfigObservableWithValue". It is initializing this property with a new instance of "SimpleConfigObservableWithValue" and passing in the current object (this) and a boolean value of false.

Public id
Type : string
Inherited from MapLayer
Defined in MapLayer:102

The above code is declaring a public property called "id" of type string in a TypeScript class.

Static Readonly IMAGE_OVERLAY_LAYER_TYPE
Type : string
Default value : 'imageOverlay'
Inherited from MapLayer
Defined in MapLayer:81

The above code is defining a public static readonly variable named IMAGE_OVERLAY_LAYER_TYPE with the value 'imageOverlay'.

Protected layerBboxRetrieverFunction
Type : function
Inherited from MapLayer
Defined in MapLayer:159
Protected layerClickFeatureItemGenerator
Type : null | FeatureDisplayItemGenerator
Inherited from MapLayer
Defined in MapLayer:151

The above code is declaring a protected property called layerClickFeatureItemGenerator with a type of null or FeatureDisplayItemGenerator.

Protected leafletMapLayer
Type : L.Layer
Inherited from MapLayer
Defined in MapLayer:170

The above code is declaring a protected variable called "leafletMapLayer" of type L.Layer.

Protected leafletWrapperLayer
Type : L.LayerGroup
Inherited from MapLayer
Defined in MapLayer:167

The above code is declaring a protected variable called "leafletWrapperLayer" of type "L.LayerGroup" in TypeScript.

Protected legendCreatorFunction
Type : function
Inherited from MapLayer
Defined in MapLayer:157

The above code is defining a protected property called legendCreatorFunction in a TypeScript class. The property is a function that takes two parameters: layer of type MapLayer and http of type HttpClient. The function returns a Promise that resolves to either null or an array of Legend objects.

Static Readonly MARKERTYPE_CHARACTER
Type : string
Default value : 'character'
Inherited from MapLayer
Defined in MapLayer:61

The above code is defining a public static readonly variable named MARKERTYPE_CHARACTER with the value 'character'.

Static Readonly MARKERTYPE_FA
Type : string
Default value : 'font_awesome'
Inherited from MapLayer
Defined in MapLayer:57

The above code is declaring a public static readonly variable named MARKERTYPE_FA and assigning it the value 'font_awesome'.

Static Readonly MARKERTYPE_IMAGE
Type : string
Default value : 'image'
Inherited from MapLayer
Defined in MapLayer:53

The above code is defining a public static readonly variable named MARKERTYPE_IMAGE with the value 'image'.

Static Readonly MARKERTYPE_LINE
Type : string
Default value : 'line'
Inherited from MapLayer
Defined in MapLayer:45

The above code is defining a public static readonly variable named MARKERTYPE_LINE with the value 'line'.

Static Readonly MARKERTYPE_PIN_FA
Type : string
Default value : 'pin_font_awesome'
Inherited from MapLayer
Defined in MapLayer:65

The above code is declaring a public static readonly variable named MARKERTYPE_PIN_FA and assigning it the value 'pin_font_awesome'.

Static Readonly MARKERTYPE_POINT
Type : string
Default value : 'point'
Inherited from MapLayer
Defined in MapLayer:41

The above code is defining a public static readonly variable called MARKERTYPE_POINT with the value 'point'.

Static Readonly MARKERTYPE_POLYGON
Type : string
Default value : 'poly'
Inherited from MapLayer
Defined in MapLayer:49

The above code is defining a public static readonly variable named MARKERTYPE_POLYGON with the value 'poly'.

Static Readonly MARKERTYPE_RAW
Type : string
Default value : 'raw'
Inherited from MapLayer
Defined in MapLayer:69

The above code is declaring a public static readonly variable named MARKERTYPE_RAW and assigning it the value 'raw'.

Public name
Type : string
Inherited from MapLayer
Defined in MapLayer:105

The above code is declaring a public property called "name" of type string in a TypeScript class.

Public options
Default value : new LayerOptions<this>(this)
Inherited from MapLayer
Defined in MapLayer:142

The above code is declaring a public property called "options" and initializing it with a new instance of the "LayerOptions" class. The "LayerOptions" class is a generic class that takes the current class as a type parameter. This allows the "options" property to have access to the properties and methods of the current class.

Public toggleable
Default value : new SimpleConfigObservableWithValue<this, boolean>(this, true)
Inherited from MapLayer
Defined in MapLayer:130

The above code is declaring a public property called "toggleable" of type "SimpleConfigObservableWithValue" with a generic parameter of "this" (referring to the current class) and "boolean". It is initializing this property with a new instance of "SimpleConfigObservableWithValue" and passing in the current class (this) and a boolean value of true as arguments.

Public tryToRender
Default value : new SimpleConfigValue<this, boolean>(this, true)
Inherited from MapLayer
Defined in MapLayer:117

The above code is declaring a public variable named "tryToRender" of type "SimpleConfigValue" with a generic parameter of "this" (referring to the current class) and "boolean". It is initializing this variable with a new instance of "SimpleConfigValue" and passing in the current class instance (this) and a boolean value of true as arguments.

Protected userPostLayerAddFunction
Type : function
Default value : () => {...}
Inherited from MapLayer
Defined in MapLayer:494

The above code is defining a protected property called userPostLayerAddFunction in a TypeScript class. The property is a function that takes a parameter leafletLayer of type L.Layer (presumably from the Leaflet library) and returns a Promise that resolves to void. The function is assigned a default implementation that simply resolves the Promise immediately.

Protected userPostLayerRemoveFunction
Type : function
Default value : () => {...}
Inherited from MapLayer
Defined in MapLayer:506

The above code is defining a protected property called userPostLayerRemoveFunction in a TypeScript class. The property is a function that takes a parameter leafletLayer of type L.Layer (presumably from the Leaflet library) and returns a Promise that resolves to void. The function is initialized with an arrow function that immediately resolves the promise with no value.

Protected userPreLayerAddFunction
Type : function
Default value : () => {...}
Inherited from MapLayer
Defined in MapLayer:488

The above code is defining a protected property called userPreLayerAddFunction in a TypeScript class. The property is a function that takes no arguments and returns a Promise that resolves to void. The initial value of the property is a function that immediately resolves the Promise.

Protected userPreLayerRemoveFunction
Type : function
Default value : () => {...}
Inherited from MapLayer
Defined in MapLayer:500

The above code is defining a protected property called userPreLayerRemoveFunction in a TypeScript class. The property is a function that takes a leafletLayer parameter of type L.Layer and returns a Promise<void>. The function is assigned a default implementation that resolves the promise immediately.

Public visibleOnLayerControl
Default value : new SimpleConfigValue<this, boolean>(this, true)
Inherited from MapLayer
Defined in MapLayer:111

The above code is declaring a public property called visibleOnLayerControl of type SimpleConfigValue<this, boolean>. It is initializing this property with a new instance of SimpleConfigValue and passing this (referring to the current instance of the class) and true as arguments to the constructor.

Methods

Public getLeafletLayer
getLeafletLayer()
Inherited from MapLayer
Defined in MapLayer:84

The function getLeafletLayer returns a Promise that resolves to a Leaflet TileLayer with a specified URL and options. L.TileLayer with the provided URL and options.

Returns : Promise<null | L.Layer>

A Promise that resolves to either null or an instance of L.Layer, specifically a L.TileLayer with the provided URL and options.

Public setAttr
setAttr(attr: string)

The function setAttr sets an attribute value and updates the options with the new attribution. the attribute value being set for the object. class.

Parameters :
Name Type Optional Description
attr string No
  • The attr parameter in the setAttr method is a string that represents the attribute value being set for the object.
Public setSubdomain
setSubdomain(sd: Array)

The function setSubdomain sets the subdomain property of an object and updates the options accordingly. for a particular object. The sd parameter is an array of strings that represents the subdomains to be set for the object. referred to as this).

Parameters :
Name Type Optional Description
sd Array<string> No
  • The setSubdomain method in the code snippet is a function that sets the subdomains for a particular object. The sd parameter is an array of strings that represents the subdomains to be set for the object.
Public setUrl
setUrl(url: string)

The function setUrl in TypeScript sets the URL property of an object and returns the object itself for method chaining. used to set the URL value for the object or instance on which the method is called.

Parameters :
Name Type Optional Description
url string No
  • The url parameter in the setUrl method is a string type parameter. It is used to set the URL value for the object or instance on which the method is called.
Public addClickListener
addClickListener(func: (clickEvent: L.LeafletMouseEvent) => void)
Inherited from MapLayer
Defined in MapLayer:426

The addClickListener function subscribes to a click event source and executes a callback function when a click event occurs. L.LeafletMouseEvent and returns void.

Parameters :
Name Type Optional Description
func function No
  • The func parameter is a function that takes a clickEvent parameter of type L.LeafletMouseEvent and returns void.
Public addSelfToMap
addSelfToMap(eposLeaflet: EposLeafletComponent)
Inherited from MapLayer
Defined in MapLayer:229

The function addSelfToMap adds a Leaflet layer to a map and performs various operations before and after adding the layer. EposLeafletComponent class.

Parameters :
Name Type Optional Description
eposLeaflet EposLeafletComponent No
  • EposLeafletComponent - an instance of the EposLeafletComponent class.
Returns : Promise<void>

The function addSelfToMap returns a Promise that resolves to void.

Protected bringLayerToBack
bringLayerToBack(refIndex: number)
Inherited from MapLayer
Defined in MapLayer:642

The function brings a layer to the back of the map. layer you want to bring to the back.

Parameters :
Name Type Optional Description
refIndex number No
  • The refIndex parameter is a number that represents the index of the layer you want to bring to the back.
Returns : void
Protected bringLayerToFront
bringLayerToFront(refIndex: number)
Inherited from MapLayer
Defined in MapLayer:632

The function brings a specific layer to the front in a Leaflet map. layer that you want to bring to the front.

Parameters :
Name Type Optional Description
refIndex number No
  • The refIndex parameter is a number that represents the index of the layer that you want to bring to the front.
Returns : void
Protected checkOpacityOnAdd
checkOpacityOnAdd()
Inherited from MapLayer
Defined in MapLayer:583

The function checks the opacity value for a custom layer option and sets it to a default value if it is not provided, and triggers an update if necessary.

Returns : void
Public click
click(clickEvent: L.LeafletMouseEvent)
Inherited from MapLayer
Defined in MapLayer:415

The click function in TypeScript triggers a click event and emits it to the clickSource. event object that is triggered when a click event occurs on a Leaflet map.

Parameters :
Name Type Optional Description
clickEvent L.LeafletMouseEvent No
  • The clickEvent parameter is of type L.LeafletMouseEvent. It represents the event object that is triggered when a click event occurs on a Leaflet map.
Returns : void
Protected ensureAddedToMap
ensureAddedToMap()
Inherited from MapLayer
Defined in MapLayer:545

The function ensureAddedToMap is a protected method that returns a promise and is used to check if a layer has been fully added to a map.

Returns : Promise<void>

A Promise that resolves to void.

Public getEposLeaflet
getEposLeaflet()
Inherited from MapLayer
Defined in MapLayer:475

The function returns an instance of the EposLeafletComponent.

The method is returning an instance of the EposLeafletComponent.

Public getLayerBbox
getLayerBbox(http: HttpClient)
Inherited from MapLayer
Defined in MapLayer:399
Parameters :
Name Type Optional
http HttpClient No
Returns : Promise<null | Array>
Public getLayerClickFeatureItem
getLayerClickFeatureItem(clickEvent: L.LeafletMouseEvent, http: HttpClient)
Inherited from MapLayer
Defined in MapLayer:462

The function returns an array of feature display items based on a click event and an HTTP client. It contains information about the click event, such as the coordinates of the click and the target element that was clicked on. used to make HTTP requests. It is likely being used in the getFeatureDisplayItems method of the layerClickFeatureItemGenerator object to fetch data from a server.

Parameters :
Name Type Optional Description
clickEvent L.LeafletMouseEvent No
  • The clickEvent parameter is an object that represents a Leaflet mouse event. It contains information about the click event, such as the coordinates of the click and the target element that was clicked on.
http HttpClient No
  • The http parameter is an instance of the HttpClient class, which is used to make HTTP requests. It is likely being used in the getFeatureDisplayItems method of the layerClickFeatureItemGenerator object to fetch data from a server.

a Promise that resolves to an array of FeatureDisplayItem objects.

Public getLayerClickFeatureItemGenerator
getLayerClickFeatureItemGenerator()
Inherited from MapLayer
Defined in MapLayer:448

The function returns the layerClickFeatureItemGenerator or null. class.

The method is returning either null or an instance of the FeatureDisplayItemGenerator class.

Protected getLeafletLayerFromMap
getLeafletLayerFromMap()
Inherited from MapLayer
Defined in MapLayer:567

The function returns a Leaflet layer object from a map based on a specified ID.

Returns : null | L.Layer

either null or an instance of L.Layer.

Public getLegendData
getLegendData(http: HttpClient)
Inherited from MapLayer
Defined in MapLayer:386

The function getLegendData returns a promise that resolves to an array of Legend objects or null, and catches any errors that occur during the promise execution. of the Angular HttpClient class, which is used to send HTTP requests and handle responses. It is used in the legendCreatorFunction to make an HTTP request and retrieve the legend data.

Parameters :
Name Type Optional Description
http HttpClient No
  • The http parameter is of type HttpClient. It is likely an instance of the Angular HttpClient class, which is used to send HTTP requests and handle responses. It is used in the legendCreatorFunction to make an HTTP request and retrieve the legend data.
Returns : Promise<null | Array>

a Promise that resolves to either null or an array of Legend objects.

Public getStylable
getStylable()
Inherited from MapLayer
Defined in MapLayer:482

The function returns an instance of the Stylable class or void.

Returns : Stylable | void
Protected hasImageOverlay
hasImageOverlay(data: GeoJsonObject)
Inherited from MapLayer
Defined in MapLayer:689

The function checks if a given GeoJsonObject has an image overlay. type representing a GeoJSON object. GeoJSON is a format for encoding a variety of geographic data structures. It can represent different types of geometries (e.g., points, lines, polygons) and collections of features (

Parameters :
Name Type Optional Description
data GeoJsonObject No
  • The data parameter is of type GeoJsonObject, which is a generic type representing a GeoJSON object. GeoJSON is a format for encoding a variety of geographic data structures. It can represent different types of geometries (e.g., points, lines, polygons) and collections of features (
Returns : boolean

a boolean value.

Protected postLayerAdd
postLayerAdd()
Inherited from MapLayer
Defined in MapLayer:520

The function "postLayerAdd" returns a promise that resolves to void.

Returns : Promise<void>

A Promise that resolves to void.

Protected postLayerRemove
postLayerRemove()
Inherited from MapLayer
Defined in MapLayer:536

The function "postLayerRemove" returns a promise that resolves to void.

Returns : Promise<void>

A Promise that resolves to void.

Protected preLayerAdd
preLayerAdd()
Inherited from MapLayer
Defined in MapLayer:513

The function ensures that a specific pane exists in a Leaflet map.

Returns : Promise<void>

A Promise that resolves to void.

Protected preLayerRemove
preLayerRemove()
Inherited from MapLayer
Defined in MapLayer:528

The function "preLayerRemove" returns a promise that resolves to void.

Returns : Promise<void>

A Promise that resolves to void.

Protected processForFeatureIdentification
processForFeatureIdentification(data: GeoJsonObject)
Inherited from MapLayer
Defined in MapLayer:655

The function processes a GeoJsonObject by adding a geometry property to features that don't have one, using the bbox property from an imageOverlayObj. geographic object in GeoJSON format. It can be either a single feature or a collection of features.

Parameters :
Name Type Optional Description
data GeoJsonObject No
  • The data parameter is of type GeoJsonObject, which represents a geographic object in GeoJSON format. It can be either a single feature or a collection of features.
Returns : GeoJsonObject

the modified data object after processing it for feature identification.

Public removeSelfFromMap
removeSelfFromMap()
Inherited from MapLayer
Defined in MapLayer:280

The removeSelfFromMap function removes a layer from a Leaflet map and performs pre and post removal actions.

Returns : Promise<void>

a Promise that resolves to void (i.e., no value).

Public setLayerBboxRetrieverFunction
setLayerBboxRetrieverFunction(layerBboxRetrieverFunction: (layer: MapLayer,http: HttpClient) => void)
Inherited from MapLayer
Defined in MapLayer:372
Parameters :
Name Type Optional
layerBboxRetrieverFunction function No
Public setLayerClickFeatureItemGenerator
setLayerClickFeatureItemGenerator(featureItemGenerator: null | FeatureDisplayItemGenerator)
Inherited from MapLayer
Defined in MapLayer:438

The function sets the layer click feature item generator and returns the current object. parameter is of type null or FeatureDisplayItemGenerator. It is used to set the generator for creating feature display items when a layer is clicked.

Parameters :
Name Type Optional Description
featureItemGenerator null | FeatureDisplayItemGenerator No
  • The featureItemGenerator parameter is of type null or FeatureDisplayItemGenerator. It is used to set the generator for creating feature display items when a layer is clicked.
Public setLegendCreatorFunction
setLegendCreatorFunction(legendCreatorFunction: (layer: MapLayer,http: HttpClient) => void)
Inherited from MapLayer
Defined in MapLayer:365

The function sets a legend creator function for a map layer in TypeScript. HttpClient object, and returns a Promise that resolves to either null or an array of Legend objects.

Parameters :
Name Type Optional Description
legendCreatorFunction function No
  • A function that takes two parameters: a MapLayer object and an HttpClient object, and returns a Promise that resolves to either null or an array of Legend objects.
Public setPostLayerAddFunction
setPostLayerAddFunction(func: null | )
Inherited from MapLayer
Defined in MapLayer:330

The function sets a callback function to be executed after a Leaflet layer is added to the map. function that takes a leafletLayer object of type L.Layer as its argument and returns a Promise<void>. It can be either null or a function.

Parameters :
Name Type Optional Description
func null | No
  • The func parameter is a function that takes a leafletLayer object of type L.Layer as its argument and returns a Promise<void>. It can be either null or a function.
Public setPostLayerRemoveFunction
setPostLayerRemoveFunction(func: null | )
Inherited from MapLayer
Defined in MapLayer:353

The function sets a callback function to be executed when a leaflet layer is removed. function that takes a leafletLayer object of type L.Layer as its argument and returns a Promise<void>. It can be either null or a function.

Parameters :
Name Type Optional Description
func null | No
  • The func parameter is a function that takes a leafletLayer object of type L.Layer as its argument and returns a Promise<void>. It can be either null or a function.
Public setPreLayerAddFunction
setPreLayerAddFunction(func: null | )
Inherited from MapLayer
Defined in MapLayer:319

The function sets a pre-layer add function for a TypeScript class. arguments and returns a promise that resolves to void. It can be either null or a function.

Parameters :
Name Type Optional Description
func null | No
  • The func parameter is a function that takes no arguments and returns a promise that resolves to void. It can be either null or a function.
Public setPreLayerRemoveFunction
setPreLayerRemoveFunction(func: null | )
Inherited from MapLayer
Defined in MapLayer:342

The function sets a callback function that will be executed before removing a layer in a Leaflet map. layer as a parameter and returns a Promise that resolves when the layer is removed. This function can be null if no pre-layer remove function is needed.

Parameters :
Name Type Optional Description
func null | No
  • A function that takes a Leaflet layer as a parameter and returns a Promise that resolves when the layer is removed. This function can be null if no pre-layer remove function is needed.
Protected updateHidden
updateHidden()
Inherited from MapLayer
Defined in MapLayer:604

The function updates the visibility of a Leaflet map layer based on a hidden property.

Returns : void
Protected updateLeafletLayerMarker
updateLeafletLayerMarker()
Inherited from MapLayer
Defined in MapLayer:623
Protected updateLeafletLayerOpacity
updateLeafletLayerOpacity()
Inherited from MapLayer
Defined in MapLayer:617

The function updates the opacity of a Leaflet map layer based on a custom option.

Returns : void
import * as L from 'leaflet';
import { MapLayer } from './mapLayer.abstract';

// options: http://leafletjs.com/reference-1.2.0.html#tilelayer
export class TileLayer extends MapLayer {
  public url: string;
  public attr: string;
  public sd: Array<string>;

  constructor(id: string, name?: string) {
    super(id, name);
    // Default options
    this.options.setOptions({
      pane: 'tilePane',
    });
  }

  /**
   * The function `setUrl` in TypeScript sets the URL property of an object and returns the object
   * itself for method chaining.
   * @param {string} url - The `url` parameter in the `setUrl` method is a string type parameter. It is
   * used to set the URL value for the object or instance on which the method is called.
   * @returns The `this` keyword is being returned, which allows for method chaining.
   */
  public setUrl(url: string): this {
    this.url = url;
    return this;
  }

  /**
   * The function `setAttr` sets an attribute value and updates the options with the new attribution.
   * @param {string} attr - The `attr` parameter in the `setAttr` method is a string that represents
   * the attribute value being set for the object.
   * @returns The method `setAttr` is returning `this`, which refers to the current instance of the
   * class.
   */
  public setAttr(attr: string): this {
    this.attr = attr;
    const opt = this.options.getAll();
    opt.attribution = attr;
    this.options.setOptions(opt);
    return this;
  }

  /**
   * The function `setSubdomain` sets the subdomain property of an object and updates the options
   * accordingly.
   * @param sd - The `setSubdomain` method in the code snippet is a function that sets the subdomains
   * for a particular object. The `sd` parameter is an array of strings that represents the subdomains
   * to be set for the object.
   * @returns The `setSubdomain` method is returning the current instance of the class (usually
   * referred to as `this`).
   */
  public setSubdomain(sd: Array<string>): this {
    this.sd = sd;
    const opt = this.options.getAll();
    opt.subdomains = sd;
    this.options.setOptions(opt);
    return this;
  }

  /**
   * The function `getLeafletLayer` returns a Promise that resolves to a Leaflet TileLayer with a
   * specified URL and options.
   * @returns A Promise that resolves to either `null` or an instance of `L.Layer`, specifically a
   * `L.TileLayer` with the provided URL and options.
   */
  public getLeafletLayer(): Promise<null | L.Layer> {
    return Promise.resolve(new L.TileLayer(this.url, this.options.getAll()));
  }
}

results matching ""

    No results matching ""