Home Reference Source Repository

Function

Static Public Summary
public

bundleEs2015Multiple(fileArray: Array<Array<string>>, production: boolean): *

make multiple bundles

public

calculateExtent(layers: Array<LayerBaseVector> | Array<ol.layer.Vector> | LayerBaseVector | ol.layer.Vector | *): ol.Extent | Array<number> | *

public

Given a date return a string in the format YYYYmmdd_hh0000

public

Given a date return a string in the format YYYY-mm-dd hh:MM:SS

public

check if the input is defined and not null

public

fitToMap(layers: Array<LayerBaseVector> | Array<ol.layer.Vector> | LayerBaseVector | ol.layer.Vector, mp: ol.Map, zoomOut: number | undefined)

given one or an array of layers, fit to the map

public
public

hexAlphaToRgbOrRgba(hexString: string, alphaVal: number): string

Convert hex string to RGB or RGBA string

public

iterate over the key value pairs of an object

public

Make a blue green red gradient

public

Create a function that will return colors based on a gradient

public
public

guids are used to uniquely identify groups and features

public

make map service legent

public

overflowScroll($table: jQuery, $tableContainer: jQuery, options: object)

public

processLessFile(inputFile: string, outputFile: string): *

convert less file

public

wrapper to define a style function by properties and zoom level

public

provide(namespace: string): object

create a namespace on the gv object

public

quickMap(options: object): ol.Map

Sets up a map with some default parameters and initializes mapMove and mapPopup

public

quickMapBase(options: object): ol.Map

Sets up a map with some default parameters and initializes mapMove and mapPopup

public

Sets up a map with some default parameters and initializes mapMove and mapPopup

public

resolutionToZoom(resolution: number): number | *

Get resolution from the zoom level

public

responsiveScroll($table: jQuery, $responsiveContainer: jQuery, options: object)

public

converts an RGB string to hex

public

rgbToRgba(rgb: string, alpha: number): string

adds alpha value to rgb string 'rgb(r, b, g)', returns 'rgba(r, g, b, a)'

public

check if the input is undefined or null

public

windowScroll($table: jQuery, options: object)

implement the default window scroll

public

zoomToResolution(zoomLevel: number): number | *

Get the resolution given the zoom level

Static Public

public bundleEs2015Multiple(fileArray: Array<Array<string>>, production: boolean): * source

import {bundleEs2015Multiple} from 'webmapsjs/src/gulp-helpers.js'

make multiple bundles

Params:

NameTypeAttributeDescription
fileArray Array<Array<string>>

array with elements [input file, output file]

production boolean

if is production

Return:

*

output stream

public calculateExtent(layers: Array<LayerBaseVector> | Array<ol.layer.Vector> | LayerBaseVector | ol.layer.Vector | *): ol.Extent | Array<number> | * source

import {calculateExtent} from 'webmapsjs/src/olHelpers/extentUtil.js'

Params:

NameTypeAttributeDescription
layers Array<LayerBaseVector> | Array<ol.layer.Vector> | LayerBaseVector | ol.layer.Vector | *

array of layers or single

Return:

ol.Extent | Array<number> | *

collective extent

public dateToYyyyMmDdHh000(dte: Date): string source

import {dateToYyyyMmDdHh000} from 'webmapsjs/src/util/dateConvert.js'

Given a date return a string in the format YYYYmmdd_hh0000

Params:

NameTypeAttributeDescription
dte Date

the input date

Return:

string

the formatted date string

public dateToYyyyMmDdHhMmSs(dte: Date): string source

import {dateToYyyyMmDdHhMmSs} from 'webmapsjs/src/util/dateConvert.js'

Given a date return a string in the format YYYY-mm-dd hh:MM:SS

Params:

NameTypeAttributeDescription
dte Date

to convert

Return:

string

the formatted date string

public definedAndNotNull(input: *): boolean source

import {definedAndNotNull} from 'webmapsjs/src/util/checkDefined.js'

check if the input is defined and not null

Params:

NameTypeAttributeDescription
input *

input pointer

Return:

boolean

true defined and not null

public fitToMap(layers: Array<LayerBaseVector> | Array<ol.layer.Vector> | LayerBaseVector | ol.layer.Vector, mp: ol.Map, zoomOut: number | undefined) source

import {fitToMap} from 'webmapsjs/src/olHelpers/extentUtil.js'

given one or an array of layers, fit to the map

Params:

NameTypeAttributeDescription
layers Array<LayerBaseVector> | Array<ol.layer.Vector> | LayerBaseVector | ol.layer.Vector

array of layers or single

mp ol.Map

the map to fit

zoomOut number | undefined
  • optional
  • default: undefined

levels to zoom out after fit

public getUrlParams(): object source

import getUrlParams from 'webmapsjs/src/util/getUrlParams.js'

Return:

object

object representation of url params

public hexAlphaToRgbOrRgba(hexString: string, alphaVal: number): string source

import {hexAlphaToRgbOrRgba} from 'webmapsjs/src/util/colors.js'

Convert hex string to RGB or RGBA string

Params:

NameTypeAttributeDescription
hexString string

hex color string

alphaVal number
  • optional
  • default: undefined

Alpha value

Return:

string

rgb or rgba color

public keyValPairs(obj: object): Array<keyValuePair> source

import {keyValPairs} from 'webmapsjs/src/util/objectHelpers.js'

iterate over the key value pairs of an object

Params:

NameTypeAttributeDescription
obj object

the input object

Return:

Array<keyValuePair>

array of key value pairs

public makeBlueGreenRedGradient(minVal: number, maxVal: number, flipColors: boolean): colorLookupByNumber source

import {makeBlueGreenRedGradient} from 'webmapsjs/src/util/colors.js'

Make a blue green red gradient

Params:

NameTypeAttributeDescription
minVal number

minimum value

maxVal number

maximum value

flipColors boolean

if the colors should be flipped

Return:

colorLookupByNumber

color lookup function

public makeBlueGreenRedGradientZScore(median: number, stdDev: number, flipColors: boolean): colorLookupByNumber source

import {makeBlueGreenRedGradientZScore} from 'webmapsjs/src/util/colors.js'

Create a function that will return colors based on a gradient

Params:

NameTypeAttributeDescription
median number

median value

stdDev number

standard deviation

flipColors boolean

if the colors should be flipped

Return:

colorLookupByNumber

color lookup function

public makeFeatureServiceLegendAndSymbol(esriResponse: object): styleAndLegend source

import {makeFeatureServiceLegendAndSymbol} from 'webmapsjs/src/olHelpers/esriToOlStyle.js'

Params:

NameTypeAttributeDescription
esriResponse object

layer info

Return:

styleAndLegend

style and legend object

public makeGuid(): string source

import makeGuid from 'webmapsjs/src/util/makeGuid.js'

guids are used to uniquely identify groups and features

Return:

string

a new guid

public makeMapServiceLegend(esriResponse: object): string source

import {makeMapServiceLegend} from 'webmapsjs/src/olHelpers/esriToOlStyle.js'

make map service legent

Params:

NameTypeAttributeDescription
esriResponse object

layer info

Return:

string

legend content

public overflowScroll($table: jQuery, $tableContainer: jQuery, options: object) source

import {overflowScroll} from 'webmapsjs/src/jquery/floatthead.js'

Params:

NameTypeAttributeDescription
$table jQuery

jquery reference to table

$tableContainer jQuery

jquery reference to table

options object
  • optional
  • default: {}

float options

public processLessFile(inputFile: string, outputFile: string): * source

import {processLessFile} from 'webmapsjs/src/gulp-helpers.js'

convert less file

Params:

NameTypeAttributeDescription
inputFile string

input less file

outputFile string

output css file

Return:

*

stream

public propertiesZoomStyle(styleFunc: propertiesZoomStyle | *): function | * source

import propertiesZoomStyle from 'webmapsjs/src/olHelpers/propertiesZoomStyle.js'

wrapper to define a style function by properties and zoom level

Params:

NameTypeAttributeDescription
styleFunc propertiesZoomStyle | *

style function

Return:

function | *

new function

public provide(namespace: string): object source

import provide from 'webmapsjs/src/util/provide.js'

create a namespace on the gv object

Params:

NameTypeAttributeDescription
namespace string

to create

Return:

object

object representing the namespace

public quickMap(options: object): ol.Map source

Sets up a map with some default parameters and initializes mapMove and mapPopup

Params:

NameTypeAttributeDescription
options object
  • optional
  • default: {}

config options

options.divId string
  • optional
  • default: map

map div id

options.center object
  • optional
  • default: {}

center config object

options.center.x number
  • optional
  • default: -10018378

center x, web mercator x or lon

options.center.y number
  • optional
  • default: 5574910

center y, web mercator y or lat

options.zoom number
  • optional
  • default: 7

zoom level

options.minZoom number
  • optional
  • default: undefined

min zoom

options.maxZoom number
  • optional
  • default: undefined

max zoom

options.baseSwitcher boolean
  • optional
  • default: true

if add base map switcher

options.fullScreen boolean
  • optional
  • default: false

if add base map switcher

Return:

ol.Map

the ol map

public quickMapBase(options: object): ol.Map source

import quickMapBase from 'webmapsjs/src/olHelpers/quickMapBase.js'

Sets up a map with some default parameters and initializes mapMove and mapPopup

Params:

NameTypeAttributeDescription
options object
  • optional
  • default: {}

config options

options.divId string
  • optional
  • default: map

map div id

options.center object
  • optional
  • default: {}

center config object

options.center.x number
  • optional
  • default: -10018378

center x, web mercator x or lon

options.center.y number
  • optional
  • default: 5574910

center y, web mercator y or lat

options.zoom number
  • optional
  • default: 7

zoom level

options.minZoom number
  • optional
  • default: undefined

min zoom

options.maxZoom number
  • optional
  • default: undefined

max zoom

options.baseSwitcher boolean
  • optional
  • default: true

if add base map switcher

options.fullScreen boolean
  • optional
  • default: false

if add base map switcher

Return:

ol.Map

the ol map

public quickMapMulti(options: object): quickMapMultiReturn source

import quickMapMulti from 'webmapsjs/src/olHelpers/quickMapMulti.js'

Sets up a map with some default parameters and initializes mapMove and mapPopup

Params:

NameTypeAttributeDescription
options object
  • optional
  • default: {}

config options

options.divId string
  • optional
  • default: map

map div id

options.center object
  • optional
  • default: {}

center config object

options.center.x number
  • optional
  • default: -10018378

center x, web mercator x or lon

options.center.y number
  • optional
  • default: 5574910

center y, web mercator y or lat

options.zoom number
  • optional
  • default: 7

zoom level

options.minZoom number
  • optional
  • default: undefined

min zoom

options.maxZoom number
  • optional
  • default: undefined

max zoom

options.baseSwitcher boolean
  • optional
  • default: true

if add base map switcher

options.fullScreen boolean
  • optional
  • default: false

if add base map switcher

Return:

quickMapMultiReturn

return map, map move, and map popup objects

public resolutionToZoom(resolution: number): number | * source

import {resolutionToZoom} from 'webmapsjs/src/olHelpers/zoomResolutionConvert.js'

Get resolution from the zoom level

Params:

NameTypeAttributeDescription
resolution number

the resolution

Return:

number | *

the zoom level

public responsiveScroll($table: jQuery, $responsiveContainer: jQuery, options: object) source

import {responsiveScroll} from 'webmapsjs/src/jquery/floatthead.js'

Params:

NameTypeAttributeDescription
$table jQuery

jquery reference to table

$responsiveContainer jQuery

jquery reference to table

options object
  • optional
  • default: {}

float options

public rgb2hex(rgb: string): string source

import {rgb2hex} from 'webmapsjs/src/util/colors.js'

converts an RGB string to hex

Params:

NameTypeAttributeDescription
rgb string

rgb color

Return:

string

rbg as hex

public rgbToRgba(rgb: string, alpha: number): string source

import {rgbToRgba} from 'webmapsjs/src/util/colors.js'

adds alpha value to rgb string 'rgb(r, b, g)', returns 'rgba(r, g, b, a)'

Params:

NameTypeAttributeDescription
rgb string

rgb color

alpha number

alpha value 0 to 1

Return:

string

rgba color

public undefinedOrNull(input: *): boolean source

import {undefinedOrNull} from 'webmapsjs/src/util/checkDefined.js'

check if the input is undefined or null

Params:

NameTypeAttributeDescription
input *

input pointer

Return:

boolean

true undefined or null

public windowScroll($table: jQuery, options: object) source

import {windowScroll} from 'webmapsjs/src/jquery/floatthead.js'

implement the default window scroll

Params:

NameTypeAttributeDescription
$table jQuery

jquery reference to table

options object
  • optional
  • default: {}

float options

public zoomToResolution(zoomLevel: number): number | * source

import {zoomToResolution} from 'webmapsjs/src/olHelpers/zoomResolutionConvert.js'

Get the resolution given the zoom level

Params:

NameTypeAttributeDescription
zoomLevel number

the zoom level

Return:

number | *

the map resolution