Class: LayerBase

LayerBase

The base layer class

Constructor

(abstract) new LayerBase(url, options)

The base layer for all others
Parameters:
Name Type Description
url string url for source
options object config
Properties
Name Type Attributes Default Description
id string <optional>
makeGuid() layer id
name string <optional>
Unnamed Layer layer name
opacity number <optional>
1 opacity
visible boolean <optional>
true default visible
minZoom number <optional>
min zoom level, 0 - 28
maxZoom number <optional>
max zoom level, 0 - 28
params object <optional>
{} the get parameters to include to retrieve the layer
zIndex number <optional>
0 the z index for the layer
loadCallback function <optional>
function to call on load, context this is the layer object
legendCollapse boolean <optional>
false if the legend item should be initially collapsed
legendCheckbox boolean <optional>
true if the legend item should have a checkbox for visibility
legendContent boolean <optional>
additional content to add to the legend
Source:

Members

(protected) legendContent

set the legend content directly
Source:

legendContent :string

get the legend content
Type:
  • string
Source:

loaded :boolean

Check if the layer is loaded
Type:
  • boolean
Source:

maxResolution :number|*

get the maximum resolution
Type:
  • number | *
Source:

maxZoom :number|*

get max zoom
Type:
  • number | *
Source:

minResolution :number|*

get the minimum resolution
Type:
  • number | *
Source:

minZoom :number|*

get min zoom
Type:
  • number | *
Source:

name :string

Get the layer name
Type:
  • string
Source:

name

set the layer name
Source:

opacity :number

Get the layer opacity
Type:
  • number
Source:

opacity

Set the layer opacity
Source:

(protected) params

set the map get params
Source:

params :object

get the map get params
Type:
  • object
Source:

source :*

get the layer source
Type:
  • *
Source:

url :string

get the url
Type:
  • string
Source:

visible :boolean

Get the layer visibility
Type:
  • boolean
Source:

visible

Set the layer visibility
Source:

zIndex :number

get the z index
Type:
  • number
Source:

zIndex

set the z index
Source:

Methods

(protected) _load() → {boolean}

base load function, sets _loaded = true if it is not already
Source:
Returns:
if already loaded
Type
boolean

addLegendContent(additionalContent=opt)

add additional content to the legend
Parameters:
Name Type Attributes Description
additionalContent= string <optional>
additonal content to add
Source:

getLegendDiv() → {string}

Get the legend html, be sure to only add to the DOM once
Source:
Returns:
html for layer wrapped in a div
Type
string

refresh()

trick to refresh the layer
Source: