diff --git a/dist/_scratch/Hello.d.ts b/dist/_scratch/Hello.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dist/_scratch/_testimport.d.ts b/dist/_scratch/_testimport.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dist/collections/ItsLayerCollection.d.ts b/dist/collections/ItsLayerCollection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d3a0152ef9e280d8ea926e1b0b3d22a306bf327 --- /dev/null +++ b/dist/collections/ItsLayerCollection.d.ts @@ -0,0 +1,36 @@ +import ol = require('custom-ol'); +import LayerItsInventory from "../layers/LayerItsInventory"; +export declare class ItsLayerCollection { + _map: ol.Map; + _layers: Array<LayerItsInventory>; + /** + * Create a collection of all ITS layers + * @param {ol.Map} theMap the openlayers map + * @param {Array} [exclude=[]] array of Its layer identifiers to exclude + * + * BLUE Bluetooth Detector - Bluetooth Detector + * CABINET Cabinets - The cabinets + * CCTV Camera - Traffic Cameras + * HUT Communication Hut - Communication Hut + * VAULT Communication Vault - The communication vaults + * HAR Highway Advisory Radio - Advisory Radios + * LIGHT Lighting - Lighting + * LOOP Loop Detectors - Loop Detectors + * DMS Message Board - Message Boards and Signs + * MICROWAVE Microwave Detector - Microwave Detectors + * PULL Pull Box - A pull box + * RWIS RWIS - Road weather information system + * GATE Ramp Gate - The ramp Gates + * METER Ramp Meter - The ramp meters + * SIGNAL Signal - Traffic Signal + * TOWER Tower - The towers + * TRENCH + */ + constructor(theMap: ol.Map, exclude?: Array<string>); + /** + * Return the array of layers in this collection + * @returns {Array<LayerItsInventory>} an array of layers + */ + readonly layers: LayerItsInventory[]; +} +export default ItsLayerCollection; diff --git a/dist/collections/LayerLegend.d.ts b/dist/collections/LayerLegend.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6997b7a3272403fc28206cbd14a2aed21e754f6 --- /dev/null +++ b/dist/collections/LayerLegend.d.ts @@ -0,0 +1,26 @@ +/** + * a wrapper to make a legend + */ +declare class LayerLegend { + $divElement: any; + _legendItems: any; + layerGroup: any; + legendId: any; + /** + * + * @param {Array} legendItems array of layers or objects with {groupName: {string}, collapse: {boolean}, addCheck: {boolean}, items: {Array}} + * @param {string} divId the div where the legend should be added + * @param {object} options for legend + * @param {Array} [options.layerDivClasses=[]] optional array of classes to be applied to the layer legend divs for custom styling + * @param {string} [options.legendTitle=Legend] the legend title + * @param {boolean} [options.scaleDependent=true] if legend display is scale dependent + */ + constructor(legendItems: any, divId: any, options: any); + /** + * @param {Array} [legendItems=this._layerConfig] the legend items + * @param {Array} [parents=[]] the ordered list of groups in which this item is a member + * @private + */ + _buildTree(legendItems: any, parents?: any): void; +} +export default LayerLegend; diff --git a/dist/collections/Sliders.d.ts b/dist/collections/Sliders.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..49f946d47d0e581cdc4e6ed70210928168aaccc6 --- /dev/null +++ b/dist/collections/Sliders.d.ts @@ -0,0 +1,90 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +export interface TipSliderConfig { + label: string; + yearOptions: Array<{ + column: string; + label: string; + }>; +} +export interface TipPresetConfig { + label: string; + presets: Array<{ + column: string; + value: number; + }>; +} +export interface ChangeResponse { + paramWeights: Object; + region: string; + mmVersion: string; +} +export interface ChangeCallback { + (chg: ChangeResponse): any; +} +/** + * class to keep track of the sliders + */ +export declare class TipSliders { + $container: JQuery; + reservedPercent: number; + lockedCount: number; + notLockedCount: number; + private _sliderList; + private _sliderLookup; + private resetting; + private _changedCallback; + private _lockedList; + private _inRangeList; + private _atMinList; + private _atMaxList; + private _presetArray; + private _presetLookup; + private _$presetSelector; + private _$regionSelector; + private _$versionSelector; + /** + * + * @param sliderConfigs + * @param presetConfig + * @param divId + * @param presetSelector + * @param regionSelector + * @param versionSelector + * @param chgCallback + */ + constructor(sliderConfigs: Array<TipSliderConfig>, presetConfig: Array<TipPresetConfig>, divId: string, presetSelector: JQuery, regionSelector: JQuery, versionSelector: JQuery, chgCallback?: ChangeCallback); + _runChangedCallback(): void; + changedCallback: ChangeCallback; + setPresetValues(): void; + /** + * split array into subarrays holding the sliders + * @private + */ + _splitSliderArray(): void; + /** + * handle remainder, recursive to take care of min max overshoots + * @param {number} remain the remainder + * @param {string} skipDomId - this dom id + * @private + */ + _handleRemainder(remain: any, skipDomId: any): void; + /** + * + * @param {object} keyValList key and value list + */ + setValues(keyValList: any): void; + /** + * get the weight sum + * @returns {number} the weight sum + */ + getSum(): number; + /** + * get the parameter weights + * @returns {object} lookup with parameter weights + */ + getParams(): {}; + _addEventListeners(): void; + readonly paramWeightsRegionVersion: ChangeResponse; +} +export default TipSliders; diff --git a/dist/domUtil/SelectBoxBase.d.ts b/dist/domUtil/SelectBoxBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca9880777bdbdc9e38291f0e646ac50327537059 --- /dev/null +++ b/dist/domUtil/SelectBoxBase.d.ts @@ -0,0 +1,49 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +export interface selectChangeCallback { + /** + * + * @param theValue the current select value of the select box + */ + (theValue: string): void; +} +/** + * must return in the contents <select id="${guid}"></select> among other things + */ +export interface contentGenerator { + /** + * @param aGuid + */ + (aGuid: string): string; +} +export declare class SelectBoxBase { + _$container: JQuery; + $label: JQuery; + _box: JQuery; + _changeListeners: Array<selectChangeCallback>; + /** + * + * @param {jQuery} parent - parent container + * @param {string} labelContent + * @param {contentGenerator} [contentGen=undefined] + */ + constructor(parent: any, labelContent: any, contentGen?: contentGenerator); + /** + * + * @returns {jQuery} + */ + readonly box: JQuery; + changed(): void; + /** + * + * @param {selectChangeCallback} func + */ + addChangeListener(func: selectChangeCallback): void; + /** + * + * @param {string|number} v + */ + selectedValue: string | number; + readonly selectedText: string; +} +export default SelectBoxBase; diff --git a/dist/domUtil/day-range.d.ts b/dist/domUtil/day-range.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..433e01ba6b029d69fa5b264f7dc0f1fe72bd64b8 --- /dev/null +++ b/dist/domUtil/day-range.d.ts @@ -0,0 +1,24 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +import 'jquery-ui'; +export declare class DayRange { + _workingDayRange: number; + _$startDate: JQuery; + _$endDate: JQuery; + _maxDateRange: number; + _startDate: Date; + _endDate: Date; + /** + * constructor for the date range + * @param {number} dayRange number of days + * @param {jQuery|HTMLElement|*} jQueryRef reference to the jquery element + */ + constructor(jQueryRef: JQuery, dayRange: number); + /** + * + * @param val + */ + startDate: Date; + endDate: Date; +} +export default DayRange; diff --git a/dist/domUtil/media-control.d.ts b/dist/domUtil/media-control.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d29e13b45fca3b9bc0e2cac9d2c9798deb374677 --- /dev/null +++ b/dist/domUtil/media-control.d.ts @@ -0,0 +1,56 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +export interface changeFunction { + (newVal?: number): void; +} +export interface mediaRangeConfig { + min?: number; + max?: number; + val?: number; + step?: number; + playInterval?: number; + showAsDate?: boolean; +} +export declare class MediaControl { + _container: JQuery; + _min: number; + _max: number; + _playInterval: number; + _step: number; + _currentValue: number; + _playing: boolean; + _$btnStop: JQuery; + _$slider: JQuery; + _$valLabelVal: JQuery; + _$valLabelMin: JQuery; + _$valLabelMax: JQuery; + _interval: number; + _showAsDate: boolean; + _changeFunc: changeFunction; + /** + * + * @param element + * @param changeFunc + * @param mediaConfig + */ + constructor(element: JQuery | HTMLElement | string, changeFunc?: changeFunction, mediaConfig?: mediaRangeConfig); + stopPlaying(): void; + readonly playing: boolean; + readonly min: number; + readonly max: number; + readonly step: number; + currentValue: number; + /** + * set min and max value with step + * @param {number} newMin the new min + * @param {number} newMax the new mas + * @param {number} [newValue=newMin] the value to set + * @param {number} [newStep=(newMax-newMin)/20] step value + */ + setMinMaxValueStep(newMin: any, newMax: any, newValue: any, newStep: any): void; + /** + * + * @param {mediaCallback} newFunc the callback on change + */ + changeFunction: changeFunction; +} diff --git a/dist/domUtil/range-change.d.ts b/dist/domUtil/range-change.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8fdd4db43ba2ed5be0e6a8aabced0069125b4d9 --- /dev/null +++ b/dist/domUtil/range-change.d.ts @@ -0,0 +1,30 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +/** + * callback on range change interaction, context of this is the firing dom element + * @callback rangeChangeCallback + * @param {number} newValue + * @param {number} ratio value from 0 to 1 relative of the value to the min and max + * @param {object} evt + */ +/*** + * callback funcion after the slider has been moved + */ +export interface rangeChangedCallback { + /** + * + * @param newValue new value of the slider + * @param ratio ratio from low to high, 0 to 1 + * @param evt the original event + */ + (newValue: number, ratio: number, evt: Event): any; +} +/** + * Add a variety of listeners for range inputs applied to a common callback + * @param $slider - jquery reference to the slider + * @param {rangeChangeCallback} callback - the callback + * @param {number} [changeTimeout=75] before the callback is called + * @this {jQuery} + * @returns {jQuery} the jQuery object + */ +export declare function rangeChange($slider: JQuery, callback: rangeChangedCallback, changeTimeout: number): any; diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dist/layers/LayerBase.d.ts b/dist/layers/LayerBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..77d8575f949457a7c99443b0e458d019433c3365 --- /dev/null +++ b/dist/layers/LayerBase.d.ts @@ -0,0 +1,189 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +import ol = require('custom-ol'); +export interface LayerBaseOptions { + id?: string; + name?: string; + opacity?: number; + visible?: boolean; + minZoom?: number; + maxZoom?: number; + params?: any; + zIndex?: number; + loadCallback?: Function; + legendCollapse?: boolean; + legendCheckbox?: boolean; + legendContent?: string; +} +/** + * The base layer class + * @abstract + */ +export declare abstract class LayerBase { + protected _legendCheckbox: boolean; + protected _url: string; + protected _opacity: number; + protected _minZoom: number; + protected _maxZoom: number; + protected _visible: boolean; + protected _loaded: boolean; + protected _zIndex: number; + protected _legendContent: string; + protected _params: any; + protected _id: string; + protected _name: string; + protected _source: ol.source.Source; + protected _animate: boolean; + protected _legendCollapse: boolean; + protected _maxResolution: number; + protected _minResolution: number; + protected _$legendDiv: JQuery; + loadCallback: Function; + protected _olLayer: ol.layer.Layer; + protected _applyCollapseCalled: boolean; + /** + * The base layer for all others + * @param {string} url - url for source + * @param {object} options - config + * @param {string} [options.id=makeGuid()] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] - the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] - the z index for the layer + * @param {function} [options.loadCallback] - function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] - if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] - if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent=undefined] - additional content to add to the legend + */ + constructor(url: string, options?: LayerBaseOptions); + /** + * base load function, sets _loaded = true if it is not already + * @protected + * @returns {boolean} if already loaded + */ + _load(): boolean; + /** + * Get the legend html, be sure to only add to the DOM once + * @returns {string} html for layer wrapped in a div + */ + getLegendDiv(): string; + /** + * + * @param additionalContent - additional content to add to legend + * @private + */ + _addLegendContent(additionalContent?: string): void; + /** + * add additional content to the legend + * @param {string} [additionalContent=] - additonal content to add + */ + addLegendContent(additionalContent: any): void; + applyCollapse(): any; + /** + * trick to refresh the layer + */ + refresh(): void; + id: string; + animate: boolean; + /** + * get the legend content + * @type {string} + */ + /** + * set the legend content directly + * @param {string} newVal - new content + * @protected + */ + legendContent: string; + /** + * get the map get params + * @type {object} + */ + /** + * set the map get params + * @param {object} newParams - new get params + * @protected + */ + params: any; + /** + * get the minimum resolution + * @type {number|*} + */ + readonly minResolution: number; + /** + * get the maximum resolution + * @type {number|*} + */ + readonly maxResolution: number; + /** + * get min zoom + * @type {number|*} + */ + readonly minZoom: number; + /** + * get max zoom + * @type {number|*} + */ + readonly maxZoom: number; + /** + * get the url + * @type {string} + */ + readonly url: string; + /** + * Get the layer visibility + * @type {boolean} + */ + /** + * set the visibility + * @param visibility + */ + visible: boolean; + protected setVisible(visibility: boolean): void; + /** + * Get the layer opacity + * @type {number} + */ + /** + * Set the layer opacity + * @param {number} opacity - layer opacity + */ + opacity: number; + /** + * Get the layer name + * @type {string} + */ + /** + * set the layer name + * @param {string} newName - the new name + */ + name: string; + /** + * Check if the layer is loaded + * @type {boolean} + */ + readonly loaded: boolean; + /** + * get the layer source + * @type {*} + */ + readonly source: ol.source.Source; + protected getSource(): ol.source.Source; + /** + * get the z index + */ + /** + * set the z index + */ + zIndex: number; + protected setZIndex(newZ: number): void; + /** + * the the ol layer + */ + readonly olLayer: ol.layer.Layer; + protected getOlLayer(): ol.layer.Layer; +} +export default LayerBase; diff --git a/dist/layers/LayerBaseVector.d.ts b/dist/layers/LayerBaseVector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e8940ca8b342f9e1c7a9216f69460699004ef5 --- /dev/null +++ b/dist/layers/LayerBaseVector.d.ts @@ -0,0 +1,148 @@ +import { LayerBase, LayerBaseOptions } from './LayerBase'; +import MapMoveCls from '../olHelpers/mapMoveCls'; +import ol = require('custom-ol'); +export interface makeMapMoveParams { + /** + * + * @param lyr + * @param extent + * @param zoomLevel + */ + (lyr: LayerBaseVector, extent: Array<number>, zoomLevel?: number): any; +} +export interface LayerBaseVectorOptions extends LayerBaseOptions { + autoLoad?: boolean; + style?: ol.style.Style | Array<ol.style.Style> | ol.StyleFunction; + onDemand?: boolean; + onDemandDelay?: number; + mapMoveMakeGetParams?: makeMapMoveParams; + mapMoveObj?: MapMoveCls; + renderOrder?: (a: ol.Feature, b: ol.Feature) => number; +} +/** + * The Vector layer base + * @augments LayerBase + * @abstract + */ +export declare class LayerBaseVector extends LayerBase { + _olLayer: ol.layer.Vector; + _source: ol.source.Vector; + _style: ol.style.Style | Array<ol.style.Style> | ol.StyleFunction; + _autoLoad: boolean; + _onDemand: boolean; + _onDemandDelay: number; + _mapMoveMakeGetParams: makeMapMoveParams; + _mapMoveParams: any; + _mapMove: MapMoveCls; + _projectionMap: ol.proj.Projection; + _projection4326: ol.proj.Projection; + /** + * The base vector layer + * @param {string} url - pass an empty string to prevent default load and add from a json source + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * + * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible + * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined + * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move + * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called + * @param {mapMoveMakeGetParams} [options.mapMoveMakeGetParams=function(lyr, extent, zoomLevel){}] function to create additional map move params + * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages + * + */ + constructor(url: string, options?: LayerBaseVectorOptions); + /** + * dummy to be overridden + * @param {object} featureCollection - geojson or esrijson object + */ + addFeatures(featureCollection: any): void; + /** + * Before call to map move callback, can prevent call by returning false + * @param {number} zoom - zoom level + * @param {string} [evtType=undefined] undefined for initial load, otherwise one of 'change:center', 'change:resolution' + * @returns {boolean} if the call should proceed + */ + mapMoveBefore(zoom: any, evtType: any): boolean; + /** + * callback to generate the parameters passed in the get request + * @param {object} extent - extent object + * @param {number} extent.minX - minX + * @param {number} extent.minY - minY + * @param {number} extent.maxX - maxX + * @param {number} extent.maxY - maxY + * @param {number} zoomLevel - zoom level + */ + mapMoveMakeGetParams(extent: any, zoomLevel: any): void; + /** + * callback function on map move + * @param {object} d - the json response + */ + mapMoveCallback(d: any): void; + /** + * clear features in the layer + */ + clear(): void; + /** + * get on demand delay in miliseconds + */ + readonly onDemandDelay: number; + /** + * get if the layer is autoloaded + */ + readonly autoLoad: boolean; + /** + * get the style definition + */ + /** + * set the style + * @param style - the style or function + */ + style: ol.StyleFunction | Array<ol.style.Style> | ol.style.Style; + /** + * get the map CRS if it is defined by the map move object + */ + readonly mapCrs: string; + readonly mapProj: ol.proj.Projection; + /** + * get the map move object + * @type {MapMoveCls|*} + */ + readonly mapMove: MapMoveCls; + /** + * map move params + * @type {object} + */ + readonly mapMoveParams: any; + /** + * Set the layer visibility + * @type {boolean} + * @override + */ + visible: boolean; + /** + * get the layer vector source + * @override + */ + readonly source: ol.source.Vector; + /** + * array of ol features + */ + readonly features: Array<ol.Feature>; + /** + * + */ + readonly olLayer: ol.layer.Vector; + protected setZIndex(newZ: number): void; +} +export default LayerBaseVector; diff --git a/dist/layers/LayerBaseVectorEsri.d.ts b/dist/layers/LayerBaseVectorEsri.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf9cb05ecfaae7ef73d67986a41452b1dc492bed --- /dev/null +++ b/dist/layers/LayerBaseVectorEsri.d.ts @@ -0,0 +1,93 @@ +/** + * Created by gavorhes on 11/2/2015. + */ +import { LayerBaseVector, LayerBaseVectorOptions } from './LayerBaseVector'; +import ol = require('custom-ol'); +export interface LayerBaseVectorEsriOptions extends LayerBaseVectorOptions { + format?: string; + outSR?: number; + where?: string; + outFields?: string; + useEsriStyle?: boolean; +} +/** + * Base layer for esri vector layers + * @augments LayerBaseVector + */ +export declare class LayerBaseVectorEsri extends LayerBaseVector { + _outSR: number; + _esriFormat: ol.format.EsriJSON; + _urlCopy: string; + _useEsriStyle: boolean; + /** + * The base vector layer + * @param {string} url - url for source + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * + * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible + * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined + * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move + * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called + * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages + * + * @param {string} [options.where=1=1] the layer filter clause + * @param {string} [options.outFields=*] comma separated list of output fields, defaults to all + * @param {string} [options.format=pjson] the format the retrieve the data + * @param {number} [options.outSR=3857] the output spatial reference, defaults to web mercator + * @param {boolean} [options.useEsriStyle=false] if the map service style should be used + * @param {boolean} [options.collapseLegend=false] if the legend should be initially collapsed + * @param {number} [options.mapMoveMakeGetParams=function(extent, zoomLevel){}] function to create additional map move params + */ + constructor(url: string, options: LayerBaseVectorEsriOptions); + /** + * add additional content to the legend + * @param {string} [additionalContent=''] additional content to add to legend + */ + addLegendContent(additionalContent?: string): void; + /** + * add feature collection + * @param {object} featureCollection - features as esrijson + */ + addFeatures(featureCollection: any): void; + /** + * trigger load features + * @protected + * @returns {boolean} if already loaded + */ + _load(): boolean; + /** + * callback to generate the parameters passed in the get request + * @param {object} extent - extent object + * @param {number} extent.minX - minX + * @param {number} extent.minY - minY + * @param {number} extent.maxX - maxX + * @param {number} extent.maxY - maxY + * @param {number} zoomLevel - zoom level + */ + mapMoveMakeGetParams(extent: any, zoomLevel: any): void; + /** + * Before call to map move callback, can prevent call by returning false + * @param {number} zoom - zoom level + * @param {string} [evtType=undefined] undefined for initial load, otherwise one of 'change:center', 'change:resolution' + * @returns {boolean} if the call should proceed + */ + mapMoveBefore(zoom: any, evtType: any): boolean; + /** + * callback function on map move + * @param {object} d - the json response + */ + mapMoveCallback(d: any): void; +} +export default LayerBaseVectorEsri; diff --git a/dist/layers/LayerBaseVectorGeoJson.d.ts b/dist/layers/LayerBaseVectorGeoJson.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4b37c5c42dfb4590e8a748f4e8739f51382520e2 --- /dev/null +++ b/dist/layers/LayerBaseVectorGeoJson.d.ts @@ -0,0 +1,68 @@ +/** + * Created by gavorhes on 11/2/2015. + */ +import { LayerBaseVector, LayerBaseVectorOptions } from './LayerBaseVector'; +import ol = require('custom-ol'); +import { MapMoveCls } from "../olHelpers/mapMoveCls"; +export interface crsTransform { + dataProjection?: ol.proj.Projection; + featureProjection?: ol.proj.Projection; +} +export interface LayerBaseVectorGeoJsonOptions extends LayerBaseVectorOptions { + transform?: crsTransform; + mapMoveObj?: MapMoveCls; +} +/** + * The Vector GeoJson Layer + * @augments LayerBaseVector + */ +export declare class LayerBaseVectorGeoJson extends LayerBaseVector { + _geoJsonFormat: ol.format.GeoJSON; + _transform: crsTransform; + /** + * @param {string|null} url - resource url, set to '' to make blank layer + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * + * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible + * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined + * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move + * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called + * + * @param {object} [options.transform={}] SR transform, set as false for no transform + * @param {string} options.transform.dataProjection=EPSG:4326 the data CRS + * @param {string} options.transform.featureProjection=EPSG:3857 the feature/map CRS + * @param {mapMoveMakeGetParams} [options.mapMoveMakeGetParams=function(lyr, extent, zoomLevel){}] function to create additional map move params + * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages + */ + constructor(url?: string, options?: LayerBaseVectorGeoJsonOptions); + /** + * add feature collection + * @param {object} featureCollection - as geojson object + */ + addFeatures(featureCollection: any): void; + /** + * trigger load features + * @protected + * @returns {boolean} if already loaded + */ + _load(): boolean; + /** + * callback function on map move + * @param {object} d the json response + * @override + */ + mapMoveCallback(d: any): void; +} +export default LayerBaseVectorGeoJson; diff --git a/dist/layers/LayerBaseXyzTile.d.ts b/dist/layers/LayerBaseXyzTile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c67341a4ea6baba2bfb0328bceefbf0efad5875d --- /dev/null +++ b/dist/layers/LayerBaseXyzTile.d.ts @@ -0,0 +1,41 @@ +/** + * Created by gavorhes on 12/4/2015. + */ +import { LayerBase, LayerBaseOptions } from './LayerBase'; +import ol = require('custom-ol'); +/** + * XYZ tile + * @augments LayerBase + */ +export declare class LayerBaseXyzTile extends LayerBase { + /** + * The XYZ tile layer + * @param {string} url - url for source + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * @param {boolean} [options.useEsriStyle=false] if the map service style should be used + */ + constructor(url: string, options?: LayerBaseOptions); + /** + * + * @returns {ol.source.XYZ} the vector source + */ + readonly source: ol.source.XYZ; + /** + * + * @returns {ol.layer.Tile|ol.layer.Base|undefined} the ol layer + */ + readonly olLayer: ol.layer.Tile; +} +export default LayerBaseXyzTile; diff --git a/dist/layers/LayerEsriMapServer.d.ts b/dist/layers/LayerEsriMapServer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ec222c44d31469f4aaaa85137de3b96af3fb438 --- /dev/null +++ b/dist/layers/LayerEsriMapServer.d.ts @@ -0,0 +1,55 @@ +/// <reference types="jquery" /> +/** + * Created by gavorhes on 12/7/2015. + */ +import { LayerBase, LayerBaseOptions } from './LayerBase'; +import ol = require('custom-ol'); +export interface LayerEsriMapServerOptions extends LayerBaseOptions { + addPopup?: boolean; + showLayers?: Array<number>; +} +/** + * esri mapserver layer + * @augments LayerBase + */ +export declare class LayerEsriMapServer extends LayerBase { + _esriFormat: ol.format.EsriJSON; + _popupRequest: JQueryXHR; + /** + * The base layer for all others + * @param {string} url - resource url + * @param {object} [options] - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * @param {boolean} [options.addPopup=false] if a popup should be added + * @param {undefined|Array<number>} [options.showLayers=undefined] if a popup should be added + */ + constructor(url: any, options?: LayerEsriMapServerOptions); + /** + * add additional content to the legend + * @param {string} [additionalContent=''] additional content for legend + */ + addLegendContent(additionalContent?: string): void; + getPopupInfo(queryParams: any): void; + /** + * + * @returns {ol.source.TileArcGISRest} the vector source + */ + readonly source: ol.source.TileArcGISRest; + /** + * + * @returns the ol layer + */ + readonly olLayer: ol.layer.Tile; +} +export default LayerEsriMapServer; diff --git a/dist/layers/LayerEsriTile.d.ts b/dist/layers/LayerEsriTile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7482d4711c986334356eacec9e8646bb2f1d165f --- /dev/null +++ b/dist/layers/LayerEsriTile.d.ts @@ -0,0 +1,37 @@ +import { LayerBaseXyzTile } from './LayerBaseXyzTile'; +import { LayerBaseOptions } from './LayerBase'; +export interface LayerEsriTileOptions extends LayerBaseOptions { + useEsriStyle?: boolean; +} +/** + * Esri tile + * @augments LayerBaseXyzTile + */ +export declare class LayerEsriTile extends LayerBaseXyzTile { + _useEsriStyle: boolean; + /** + * The Esri tile layer + * @param {string} url - url for source + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * @param {boolean} [options.useEsriStyle=false] if the map service style should be used + */ + constructor(url: string, options?: LayerEsriTileOptions); + /** + * add additional content to the legend + * @param {string} [additionalContent=''] additional content for legend + */ + addLegendContent(additionalContent?: string): void; +} +export default LayerEsriTile; diff --git a/dist/layers/LayerItsInventory.d.ts b/dist/layers/LayerItsInventory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..571051f63d55ff03a1aac6a42278f5c20f4a1af1 --- /dev/null +++ b/dist/layers/LayerItsInventory.d.ts @@ -0,0 +1,67 @@ +/** + * Created by gavorhes on 12/8/2015. + */ +import LayerBaseVectorGeoJson from './LayerBaseVectorGeoJson'; +/** + * Its Layer class + * @augments LayerBaseVectorGeoJson + */ +declare class LayerItsInventory extends LayerBaseVectorGeoJson { + /** + * ITS device layer, types available at http://transportal.cee.wisc.edu/its/inventory/ + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * + * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible + * @param {object|*} [options.style=undefined] the layer style, use openlayers default style if not defined + * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move + * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called + * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages + * + * @param {string} options.itsType the ITS device type, use the url flag at http://transportal.cee.wisc.edu/its/inventory/ + * @param {boolean} [options.addPopup=true] if the popup should be added automatically + * + * @param {string} [options.itsIcon=undefined] the ITS device type icon image see http://transportal.cee.wisc.edu/its/inventory/icons/ + * + * @param {object} [options.itsLineStyle=undefined] A single line style + * @param {string} options.itsLineStyle.color the line color as rgb or hex + * @param {number} [options.itsLineStyle.width=5] the line width + * + * @param {object} [options.itsIconConfig=undefined] The icon subtype configuration + * @param {string} options.itsIconConfig.prop The property used to define icon attribute symbolization + * @param {string} options.itsIconConfig.defaultName The default name to be used if no other match is found + * @param {string} options.itsIconConfig.defaultIcon The default icon to be used for no other matches + * @param {object} [options.itsIconConfig.iconArray=[]] an array, items with format [property, name, img] + * + * @param {object} [options.itsLineConfig=undefined] The property used to define icon attribute symbolization + * @param {string} options.itsLineConfig.prop The property used to define icon attribute symbolization + * @param {string} [options.itsLineConfig.defaultName=Other] The default name to be used if no other match is found + * @param {string} [options.itsLineConfig.defaultColor=red] The default line color to be used for no other matches + * @param {number} [options.itsLineConfig.defaultWidth] The default line width to be used for no other matches + * @param {object} [options.itsLineConfig.lineArray=[]] an array, items with format [property, name, color, optional width = 5] + */ + constructor(options: any); + /** + * callback to generate the parameters passed in the get request + * @callback makeGetParams + * @param {object} extent - extent object + * @param {number} extent.minX - minX + * @param {number} extent.minY - minY + * @param {number} extent.maxX - maxX + * @param {number} extent.maxY - maxY + * @param {number} zoomLevel - zoom level + */ + mapMoveMakeGetParams(extent: any, zoomLevel: any): void; +} +export default LayerItsInventory; diff --git a/dist/layers/LayerRealEarthTile.d.ts b/dist/layers/LayerRealEarthTile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..02e594448b237c5ce244150c43b5fde82f506455 --- /dev/null +++ b/dist/layers/LayerRealEarthTile.d.ts @@ -0,0 +1,44 @@ +/** + * Created by gavorhes on 11/4/2015. + */ +import { LayerBaseXyzTile } from './LayerBaseXyzTile'; +import { LayerBaseOptions } from './LayerBase'; +import RealEarthAnimateTile from '../mixin/RealEarthAnimateTile'; +import { IRealEarthAnimate, timesLoadedCallback } from "../mixin/RealEarthAnimate"; +export interface LayerRealEarthTileOptions extends LayerBaseOptions { + products: string; + animate?: boolean; + timeLoadCallback?: timesLoadedCallback; +} +/** + * Real earth tile + * @augments LayerBaseXyzTile + */ +export declare class LayerRealEarthTile extends LayerBaseXyzTile implements IRealEarthAnimate { + _products: string; + animator: RealEarthAnimateTile; + /** + * The base layer for all others + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * + * @param {string} options.products - the products to request + * @param {boolean} [options.hasTimes=false] If the layer is time dependent, fixed set of dates + * @param {boolean} [options.animate=false] if the layer should be animated + */ + constructor(options: LayerRealEarthTileOptions); + setLayerTime(theTime: number): boolean; + _load(): boolean; +} +export default LayerRealEarthTile; diff --git a/dist/layers/LayerRealEarthVector.d.ts b/dist/layers/LayerRealEarthVector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8aa9d823c1977d9d20ac8b5d95e48346c0917230 --- /dev/null +++ b/dist/layers/LayerRealEarthVector.d.ts @@ -0,0 +1,52 @@ +/** + * Created by gavorhes on 11/13/2015. + */ +import { LayerBaseVectorGeoJson, LayerBaseVectorGeoJsonOptions } from './LayerBaseVectorGeoJson'; +import RealEarthAnimateVector from '../mixin/RealEarthAnimateVector'; +import { IRealEarthAnimate, timesLoadedCallback } from "../mixin/RealEarthAnimate"; +export interface LayerVectorRealEarthOptions extends LayerBaseVectorGeoJsonOptions { + products: string; + animate?: boolean; + timeLoadCallback?: timesLoadedCallback; +} +/** + * Vector real earth vector + * @augments LayerBaseVectorGeoJson + */ +export declare class LayerVectorRealEarth extends LayerBaseVectorGeoJson implements IRealEarthAnimate { + _products: string; + animator: RealEarthAnimateVector; + /** + * Real Earth vector layer + * @param {object} options - config + * @param {string} [options.id] - layer id + * @param {string} [options.name=Unnamed Layer] - layer name + * @param {number} [options.opacity=1] - opacity + * @param {boolean} [options.visible=true] - default visible + * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 + * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 + * @param {object} [options.params={}] the get parameters to include to retrieve the layer + * @param {number} [options.zIndex=0] the z index for the layer + * @param {function} [options.loadCallback] function to call on load, context this is the layer object + * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed + * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility + * @param {boolean} [options.legendContent] additional content to add to the legend + * + * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible + * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined + * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move + * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called + * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages + * + * @param {object} [options.transform={}] SR transform, set as false for no transform + * @param {string} options.transform.dataProjection=EPSG:4326 the data CRS + * @param {string} options.transform.featureProjection=EPSG:3857 the feature/map CRS + * + * @param {string} options.products real earth products identifier + * @param {boolean} [options.animate=false] if the layer should be animated + */ + constructor(options: LayerVectorRealEarthOptions); + setLayerTime(theTime: number): boolean; + _load(): boolean; +} +export default LayerVectorRealEarth; diff --git a/dist/mixin/RealEarthAnimate.d.ts b/dist/mixin/RealEarthAnimate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7fd6e5d09edc4d64be1e7ed74bde9da35364200 --- /dev/null +++ b/dist/mixin/RealEarthAnimate.d.ts @@ -0,0 +1,48 @@ +import LayerRealEarthTile from "../layers/LayerRealEarthTile"; +import { LayerVectorRealEarth } from '../layers/LayerRealEarthVector'; +export interface IRealEarthAnimate { + setLayerTime(theTime: number): boolean; +} +export interface timesLoadedCallback { + (lyr?: LayerRealEarthTile | LayerVectorRealEarth): void; +} +/** + * Mixin to get the product times + * Be sure to call getTimeInit after the mixin has been applied + */ +export declare class RealEarthAnimate { + _animateEnabled: boolean; + _currentIndex: number; + _localDates: Date[]; + _rawDateStrings: string[]; + _products: string; + loadCallback: timesLoadedCallback; + localTimes: number[]; + _currentTime: number; + lyr: LayerRealEarthTile | LayerVectorRealEarth; + constructor(lyr: LayerRealEarthTile | LayerVectorRealEarth, loadCallback?: timesLoadedCallback); + /** + * Call this after the mixin has been applied + */ + timeInit(): void; + /** + * Given the raw time string, add to the arrays to keep track of dates and cache + * @param {string} inString - input string to parse + * @returns {string} the converted string + * @protected + */ + _loadDates(inString: string): string; + /** + * + * @protected + * @returns {boolean} if should continue + */ + _loadLatest(): boolean; + /** + * + * @param {number} theTime - the time + * @returns {boolean} true if new index, false if the same or below lowest value + */ + setLayerTime(theTime: number): boolean; +} +export default RealEarthAnimate; diff --git a/dist/mixin/RealEarthAnimateTile.d.ts b/dist/mixin/RealEarthAnimateTile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..721fff8384a286833eae58469132c5e86181ec61 --- /dev/null +++ b/dist/mixin/RealEarthAnimateTile.d.ts @@ -0,0 +1,24 @@ +/** + * Created by gavorhes on 12/4/2015. + */ +import RealEarthAnimate from './RealEarthAnimate'; +import ol = require('custom-ol'); +import LayerRealEarthTile from "../layers/LayerRealEarthTile"; +/** + * Animate real earth tile + * @augments RealEarthAnimate + */ +declare class RealEarthAnimateTile extends RealEarthAnimate { + _sourceUrls: string[]; + _source: ol.source.XYZ; + _olLayer: ol.layer.Tile; + constructor(layer: LayerRealEarthTile, loadCallback?: (lyr: LayerRealEarthTile) => void); + timeInit(): void; + _loadDates(inString: string): string; + /** + * @protected + */ + _loadLatest(): boolean; + setLayerTime(theTime: number): boolean; +} +export default RealEarthAnimateTile; diff --git a/dist/mixin/RealEarthAnimateVector.d.ts b/dist/mixin/RealEarthAnimateVector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0823ece69963555873b41b760b510fab5b9b5d4e --- /dev/null +++ b/dist/mixin/RealEarthAnimateVector.d.ts @@ -0,0 +1,50 @@ +/** + * Created by gavorhes on 12/4/2015. + */ +import RealEarthAnimate from './RealEarthAnimate'; +import ol = require('custom-ol'); +import { LayerVectorRealEarth } from "../layers/LayerRealEarthVector"; +/** + * class mixin to animate RealEarth vector layers + * @augments RealEarthAnimate + */ +declare class RealEarthAnimateVector extends RealEarthAnimate { + _dataCache: Array<Array<Object> | Object>; + _source: ol.source.Vector; + _rawTimesLookup: { + [s: string]: any; + }; + _currentIndex: number; + _olLayer: ol.layer.Vector; + _lyr: LayerVectorRealEarth; + constructor(layer: LayerVectorRealEarth, loadCallback?: (lyr: LayerVectorRealEarth) => void); + /** + * Call this after the mixin has been applied + */ + timeInit(): void; + /** + * Given the raw time string, add to the arrays to keep track of dates and cache + * @param {string} inString - input date string + * @protected + */ + _loadDates(inString: string): string; + /** + * @protected + */ + _loadLatest(): boolean; + /** + * Load the features at the date index specified + * @param {number} i the index of the features to be loaded by date + * @param {boolean} [setAsSource=true] set to false to trigger cache load only + * @private + */ + _loadAtTimeIndex(i: number, setAsSource?: boolean): void; + /** + * helper to load the features at the index specified + * @param {object} geojObj - the geojson object + * @private + */ + _loadFeatures(geojObj: any): void; + setLayerTime(theTime: number): boolean; +} +export default RealEarthAnimateVector; diff --git a/dist/olHelpers/SortedFeatures.d.ts b/dist/olHelpers/SortedFeatures.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7cb0279a348b3efcce8c3576a85d63d14968ca53 --- /dev/null +++ b/dist/olHelpers/SortedFeatures.d.ts @@ -0,0 +1,24 @@ +import ol = require('custom-ol'); +/** + * take an array of features and sort by a given property name + */ +declare class SortedFeatures { + sortedFeatures: Array<ol.Feature>; + propertyName: string; + _propertyType: string; + /** + * + * @param {Array<ol.Feature>} features array of ol features + * @param {string} propertyName - the property name to use for lookup + */ + constructor(features: any, propertyName: any); + /** + * recursive search to find the value + * @param {number|string} propertyValue - the property value to search for + * @param {boolean} [exactMatch=false] if only an exact match should be returned + * @param {Array} [sortedFeatures=this.sortedFeatures] - the candidate features + * @returns {ol.Feature|undefined} the feature matching the lookup + */ + getFeature(propertyValue: any, exactMatch?: boolean, sortedFeatures?: Array<ol.Feature>): any; +} +export default SortedFeatures; diff --git a/dist/olHelpers/esriToOlStyle.d.ts b/dist/olHelpers/esriToOlStyle.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..639b8bd3d12f282a0ef9784ba772e4d624621e1a --- /dev/null +++ b/dist/olHelpers/esriToOlStyle.d.ts @@ -0,0 +1,47 @@ +import ol = require('custom-ol'); +export interface EsriResponse { + drawingInfo: { + renderer: EsriRenderer; + }; + geometryType: string; +} +export interface EsriRenderer { + type: string; + symbol: EsriSymbol; + uniqueValueInfos: Array<{ + label: string; + value: any; + symbol: EsriSymbol; + }>; +} +export interface EsriSymbol { + size: number; + type: string; + outline: { + color: string; + width: number; + }; + color: string; + width: number; +} +/** + * style and legend object + * @typedef {object} styleAndLegend + * @property {styleFunc} style - style function + * @property {string} legend - legend content + */ +/** + * + * @param {object} esriResponse - layer info + * @returns {styleAndLegend} style and legend object + */ +export declare function makeFeatureServiceLegendAndSymbol(esriResponse: EsriResponse): { + style: ol.style.Style | ol.style.Style[] | ol.StyleFunction; + legend: string; +}; +/** + * make map service legent + * @param {object} esriResponse - layer info + * @returns {string} legend content + */ +export declare function makeMapServiceLegend(esriResponse: any): string; diff --git a/dist/olHelpers/extentUtil.d.ts b/dist/olHelpers/extentUtil.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cf9fda771405a82f0307b0e58063557ef46720bc --- /dev/null +++ b/dist/olHelpers/extentUtil.d.ts @@ -0,0 +1,15 @@ +import ol = require('custom-ol'); +import { LayerBaseVector } from "../layers/LayerBaseVector"; +/** + * + * @param {Array<LayerBaseVector>|Array<ol.layer.Vector>|LayerBaseVector|ol.layer.Vector|*} layers - array of layers or single + * @returns {ol.Extent|Array<number>|*} - collective extent + */ +export declare function calculateExtent(layers: ol.layer.Vector[] | LayerBaseVector[]): ol.Extent | Array<number> | ol.Extent | number[]; +/** + * given one or an array of layers, fit to the map + * @param layers - array of layers or single + * @param mp - the map to fit + * @param [zoomOut=undefined] - levels to zoom out after fit + */ +export declare function fitToMap(layers: ol.layer.Vector[] | LayerBaseVector[], mp: ol.Map, zoomOut?: number): void; diff --git a/dist/olHelpers/layerSwipe.d.ts b/dist/olHelpers/layerSwipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af111e6db48161b0b779b5e29959a148db9e6677 --- /dev/null +++ b/dist/olHelpers/layerSwipe.d.ts @@ -0,0 +1,32 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +import { LayerBase } from "../layers/LayerBase"; +import ol = require('custom-ol'); +declare class LayerSwipe { + leftLayers: Array<LayerBase>; + rightLayers: Array<LayerBase>; + _percentRight: number; + _map: ol.Map; + $mapElement: JQuery; + $swiper: JQuery; + dragging: boolean; + offset: number; + /** + * + * @param {ol.Map} map - the map + * @param {string} [sliderContent=''] - additional html to be added inside the slider div + */ + constructor(map: ol.Map, sliderContent?: string); + /** + * + * @param {LayerBase|*} lyr - layer to be added to left side + */ + addLeftLayer(lyr: any): void; + /** + * + * @param {LayerBase|*} lyr - layer to be added to right side + */ + addRightLayer(lyr: any): void; + percentRight: number; +} +export default LayerSwipe; diff --git a/dist/olHelpers/mapInteractionBase.d.ts b/dist/olHelpers/mapInteractionBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8dc3285c28b473b6d348b6f36d9e4a9c6d4859ab --- /dev/null +++ b/dist/olHelpers/mapInteractionBase.d.ts @@ -0,0 +1,40 @@ +import ol = require('custom-ol'); +/** + * base interaction + */ +export declare class MapInteractionBase { + _map: ol.Map; + _initialized: boolean; + _subtype: string; + /** + * map interaction base + * @param subtype - the interaction subtype + */ + constructor(subtype: string); + /** + * base initializer, returns true for already initialized + * @param theMap - the ol Map + * @returns true for already initialized + */ + init(theMap: ol.Map): void; + /** + * get reference to the ol map object + * @returns {ol.Map} the map object + */ + readonly map: ol.Map; + /** + * get if is initialized + * @returns {boolean} is initialized + */ + readonly initialized: boolean; + /** + * Check the initialization status and throw exception if not valid yet + * @protected + */ + _checkInit(): void; + /** + * Check the initialization status and throw exception if not valid yet + */ + checkInit(): void; +} +export default MapInteractionBase; diff --git a/dist/olHelpers/mapMove.d.ts b/dist/olHelpers/mapMove.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3fd28ab916a49dc6264521ce698e1e10829e983b --- /dev/null +++ b/dist/olHelpers/mapMove.d.ts @@ -0,0 +1,10 @@ +/** + * Created by gavorhes on 11/3/2015. + */ +import MapMoveCls from './mapMoveCls'; +/** + * The single map move object catch is that it is common to multimap pages + * @type {MapMoveCls} + */ +export declare const mapMove: MapMoveCls; +export default mapMove; diff --git a/dist/olHelpers/mapMoveCls.d.ts b/dist/olHelpers/mapMoveCls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..81d286ac30e7e270d08e54875d55792dea19ff12 --- /dev/null +++ b/dist/olHelpers/mapMoveCls.d.ts @@ -0,0 +1,79 @@ +import LayerBaseVector from "../layers/LayerBaseVector"; +import MapInteractionBase from './mapInteractionBase'; +import ol = require('custom-ol'); +export interface extentObject { + minX: number; + minY: number; + maxX: number; + maxY: number; +} +export interface mapMoveCallbackFunction { + /** + * + * @param extent extent as predefined object minX, minX, maxX, maxY + * @param zoomLevel current zoom level + * @param evtType the event type 'change:center', 'change:resolution' + */ + (extent: extentObject, zoomLevel: number, evtType?: string): any; +} +/** + * assists with map move interactions, trigger callback functions + * @augments MapInteractionBase + */ +export declare class MapMoveCls extends MapInteractionBase { + _mapExtent: extentObject; + _zoomLevel: number; + _lookupLayer: Object; + _arrLayer: Array<LayerBaseVector>; + _arrLyrTimeout: Array<number>; + _mapMoveCallbackTimeout: Array<number>; + _mapMoveCallbackDelays: Array<number>; + _mapMoveCallbacksLookup: Object; + _mapMoveCallbackContext: Array<Object>; + _mapMoveCallbacks: Array<mapMoveCallbackFunction>; + _arrLyrRequest: Array<any>; + /** + * constructor called implicitly + */ + constructor(); + /** + * initialize the map move object + * @param theMap - the ol map + */ + init(theMap: ol.Map): void; + _updateMapExtent(): void; + /** + * return the map extent + */ + readonly mapExtent: extentObject; + /** + * Trigger the layer load + * @param lyr the layer being acted on + * @param index index of the layer + * @param eventType the event triggering the load, as 'change:center' or 'change:resolution' + */ + triggerLyrLoad(lyr: LayerBaseVector, index?: number, eventType?: string): void; + /** + * trigger the map move call back at the given index + * @param ind - the index of the layer + * @param eventType=undefined the event triggering the load as 'change:center' or 'change:resolution' + * @param functionId=undefined the function id used to reference the added callback function + */ + triggerMoveCallback(ind: number, eventType?: string, functionId?: string): void; + /** + * Add a layer to the interaction + * @param lyr - layer to add + * @param triggerOnAdd - if the layer should be loaded on add + */ + addVectorLayer(lyr: LayerBaseVector, triggerOnAdd?: boolean): void; + /** + * add a callback to the map move event + * @param func - callback function + * @param context - the context to use for this function + * @param delay=50 the delay before call load + * @param triggerOnAdd if the layer should be loaded on add to mapMove + * @param functionId optional id to reference the function later for outside triggering + */ + addCallback(func: mapMoveCallbackFunction, context?: any, delay?: number, triggerOnAdd?: boolean, functionId?: string): void; +} +export default MapMoveCls; diff --git a/dist/olHelpers/mapPopup.d.ts b/dist/olHelpers/mapPopup.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b17d90d1618e7fdfc2c3998742eae26f10142654 --- /dev/null +++ b/dist/olHelpers/mapPopup.d.ts @@ -0,0 +1,10 @@ +/** + * Created by gavorhes on 11/3/2015. + */ +import MapPopupCls from './mapPopupCls'; +/** + * The single popup object catch is that it is common to multimap pages + * @type {MapPopupCls} + */ +export declare const mapPopup: MapPopupCls; +export default mapPopup; diff --git a/dist/olHelpers/mapPopupCls.d.ts b/dist/olHelpers/mapPopupCls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..70244fa2945f15580d1712c3584d1814f6cc5c43 --- /dev/null +++ b/dist/olHelpers/mapPopupCls.d.ts @@ -0,0 +1,159 @@ +/// <reference types="jquery" /> +/// <reference types="jqueryui" /> +/** + * Created by gavorhes on 11/3/2015. + */ +import MapInteractionBase from './mapInteractionBase'; +import ol = require('custom-ol'); +import { LayerBaseVector } from "../layers/LayerBaseVector"; +import LayerEsriMapServer from "../layers/LayerEsriMapServer"; +export interface popupChangedFunction { + ($popContent: JQuery): any; +} +/** + * + */ +export interface popupCallback { + /** + * Callback function for the popup + * @param featureProperties + * @param jqRef + */ + (featureProperties: Object, jqRef?: JQuery): string | boolean; +} +export declare class FeatureLayerProperties { + feature: ol.Feature; + layer: LayerBaseVector | LayerEsriMapServer; + layerIndex: number; + selectionLayer: ol.layer.Vector; + popupContent: string; + esriLayerName: string; + /** + * + * @param feature the feature + * @param layer - the layer in the popup + * @param layerIndex - index of the layer + * @param selectionLayer - the ol selection layer + * @param [esriLayerName=undefined] - esri layer name + */ + constructor(feature: ol.Feature, layer: LayerBaseVector | LayerEsriMapServer, layerIndex: number, selectionLayer: ol.layer.Vector, esriLayerName?: string); + readonly layerName: string; +} +/** + * map popup class + * @augments MapInteractionBase + */ +export declare class MapPopupCls extends MapInteractionBase { + private _popupOpen; + private _passThroughLayerFeatureArray; + private _currentPopupIndex; + private _popupContentLength; + private _esriMapServiceLayers; + private _$popupCloser; + private _$popupContent; + private _$popupContainer; + private _popupOverlay; + private _arrPopupLayers; + private _popupCoordinate; + private _popupChangedFunctions; + private _mapClickFunctions; + private _selectionLayerLookup; + private _arrPopupLayerIds; + private _arrPopupLayerNames; + private _arrPopupOlLayers; + private _arrPopupContentFunction; + private _selectionLayers; + /** + * Definition for openlayers style function + * @callback olStyleFunction + * ¶m feature the openlayers vector feature + * $param + */ + /** + * map popup constructor + */ + constructor(); + /** + * map popup initialization + * @param {ol.Map} theMap - the ol map + */ + init(theMap: ol.Map): boolean; + /** + * helper to select features + * @private + */ + _triggerFeatSelect(): void; + /** + * + * @param feature - the ol feature + * @param {LayerEsriMapServer} lyr - the map server layer + * @param {string} popupContent - popup content + * @param {string} esriName - esri layer name + */ + addMapServicePopupContent(feature: ol.Feature, lyr: LayerEsriMapServer, popupContent: string, esriName: string): void; + /** + * + * @param pixel - the ol pixel + * @returns feature layer properties + * @private + */ + _featuresAtPixel(pixel: ol.Pixel): Array<FeatureLayerProperties>; + closePopup(): boolean; + /** + * + * @param chgFunction - popup change function + */ + addPopupChangedFunction(chgFunction: popupChangedFunction): void; + /** + * + * @param {LayerBase|*} lyr - the layer being acted on + * @param {object} [selectionStyle={}] the selection style configuration + * @param {string} [selectionStyle.color=rgba(255,170,0,0.5)] the selection color + * @param {number} [selectionStyle.width=10] the selection width for linear features + * @param {object|function} [selectionStyle.olStyle=undefined] an openlayers style object or function + * @returns the new selection layer + * @private + */ + _addPopupLayer(lyr: LayerBaseVector, selectionStyle: { + color?: string; + width?: number; + olStyle?: ol.style.Style; + }): ol.layer.Vector; + /** + * Add popup to the map + * @param {LayerBase|*} lyr The layer that the popup with act on + * @param {popupCallback} popupContentFunction - popup content function that makes popup info + * @param {object} [selectionStyle={}] the selection style configuration + * @param {string} [selectionStyle.color=rgba(255,170,0,0.5)] the selection color + * @param {number} [selectionStyle.width=10] the selection width for linear features + * @param {object|function} [selectionStyle.olStyle=undefined] an openlayers style object or function + * @returns {object} a reference to the ol selection layer + */ + addVectorPopup(lyr: LayerBaseVector, popupContentFunction: popupCallback, selectionStyle?: { + color?: string; + width?: number; + olStyle?: ol.style.Style; + }): ol.layer.Vector; + /** + * + * @param {LayerBase} lyr - layer + */ + removeVectorPopup(lyr: any): void; + /** + * + * @param {LayerEsriMapServer} lyr - map server layer + * @param {object} [selectionStyle={}] the selection style configuration + * @param {string} [selectionStyle.color=rgba(255,170,0,0.5)] the selection color + * @param {number} [selectionStyle.width=10] the selection width for linear features + * @param {object|function} [selectionStyle.olStyle=undefined] an openlayers style object or function + * @returns {object} a reference to the ol selection layer + */ + addMapServicePopup(lyr: any, selectionStyle?: ol.style.Style | Array<ol.style.Style> | ol.StyleFunction): ol.layer.Vector; + clearSelection(): void; + /** + * Add a function to be called when the map is clicked but before any popups are implemented + * @param {function} func - the map click function + */ + addMapClickFunction(func: Function): void; +} +export default MapPopupCls; diff --git a/dist/olHelpers/projections.d.ts b/dist/olHelpers/projections.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4978d5bda07d82ace1ad8f259623ce70b351a2d --- /dev/null +++ b/dist/olHelpers/projections.d.ts @@ -0,0 +1,7 @@ +/** + * Created by gavorhes on 10/3/2016. + */ +import ol = require('custom-ol'); +export declare const proj4326: ol.proj.Projection; +export declare const proj3857: ol.proj.Projection; +export declare const proj3070: ol.proj.Projection; diff --git a/dist/olHelpers/propertiesZoomStyle.d.ts b/dist/olHelpers/propertiesZoomStyle.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e172c919912ab678a5f1ba77a4224419d1a2c496 --- /dev/null +++ b/dist/olHelpers/propertiesZoomStyle.d.ts @@ -0,0 +1,15 @@ +import ol = require('custom-ol'); +/** + * A style function based on properties and zoom level, wraps normal feature, resolution function + * @callback propertiesZoomStyle + * @param {object} properties the feature properties + * @param {number} zoom level + * + */ +/** + * wrapper to define a style function by properties and zoom level + * @param {propertiesZoomStyle|*} styleFunc - style function + * @returns {function|*} new function + */ +declare function propertiesZoomStyle(styleFunc: any): (feature: ol.Feature, resolution: any) => void; +export default propertiesZoomStyle; diff --git a/dist/olHelpers/quickMap.d.ts b/dist/olHelpers/quickMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..002c3f035ed7dcdd48d42663e8db8ec18ad9df87 --- /dev/null +++ b/dist/olHelpers/quickMap.d.ts @@ -0,0 +1,23 @@ +/** + * Created by gavorhes on 12/15/2015. + */ +import { quickMapOptions } from './quickMapBase'; +import ol = require('custom-ol'); +/** + * Sets up a map with some default parameters and initializes + * mapMove and mapPopup + * + * @param {object} [options={}] config options + * @param {string} [options.divId=map] map div id + * @param {object} [options.center={}] center config object + * @param {number} [options.center.x=-10018378] center x, web mercator x or lon + * @param {number} [options.center.y=5574910] center y, web mercator y or lat + * @param {number} [options.zoom=7] zoom level + * @param {number} [options.minZoom=undefined] min zoom + * @param {number} [options.maxZoom=undefined] max zoom + * @param {boolean} [options.baseSwitcher=true] if add base map switcher + * @param {boolean} [options.fullScreen=false] if add base map switcher + * @returns {ol.Map} the ol map + */ +export declare function quickMap(options?: quickMapOptions): ol.Map; +export default quickMap; diff --git a/dist/olHelpers/quickMapBase.d.ts b/dist/olHelpers/quickMapBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b6916c88a1f2ebd40eab2bee2e6e666cd65d944 --- /dev/null +++ b/dist/olHelpers/quickMapBase.d.ts @@ -0,0 +1,31 @@ +import ol = require('custom-ol'); +export interface quickMapOptions { + divId?: string; + center?: { + x: number; + y: number; + }; + zoom?: number; + minZoom?: number; + maxZoom?: number; + baseSwitcher?: boolean; + fullScreen?: boolean; +} +/** + * Sets up a map with some default parameters and initializes + * mapMove and mapPopup + * + * @param [options={}] config options + * @param [options.divId=map] map div id + * @param [options.center={}] center config object + * @param [options.center.x=-10018378] center x, web mercator x or lon + * @param [options.center.y=5574910] center y, web mercator y or lat + * @param [options.zoom=7] zoom level + * @param [options.minZoom=undefined] min zoom + * @param [options.maxZoom=undefined] max zoom + * @param [options.baseSwitcher=true] if add base map switcher + * @param [options.fullScreen=false] if add base map switcher + * @returns the ol map + */ +export declare function quickMapBase(options?: quickMapOptions): ol.Map; +export default quickMapBase; diff --git a/dist/olHelpers/quickMapMulti.d.ts b/dist/olHelpers/quickMapMulti.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c918d2ee3412ad005a769a6467077c936ef50405 --- /dev/null +++ b/dist/olHelpers/quickMapMulti.d.ts @@ -0,0 +1,35 @@ +/** + * Created by gavorhes on 12/15/2015. + */ +import { quickMapOptions } from './quickMapBase'; +import MapMoveCls from './mapMoveCls'; +import MapPopupCls from './mapPopupCls'; +import ol = require('custom-ol'); +/** + * @typedef {object} quickMapMultiReturn + * @property {ol.Map} map The X Coordinate + * @property {MapMoveCls} mapMove The Y Coordinate + * @property {MapPopupCls} mapPopup The Y Coordinate + */ +/** + * Sets up a map with some default parameters and initializes + * mapMove and mapPopup + * + * @param {object} [options={}] config options + * @param {string} [options.divId=map] map div id + * @param {object} [options.center={}] center config object + * @param {number} [options.center.x=-10018378] center x, web mercator x or lon + * @param {number} [options.center.y=5574910] center y, web mercator y or lat + * @param {number} [options.zoom=7] zoom level + * @param {number} [options.minZoom=undefined] min zoom + * @param {number} [options.maxZoom=undefined] max zoom + * @param {boolean} [options.baseSwitcher=true] if add base map switcher + * @param {boolean} [options.fullScreen=false] if add base map switcher + * @returns return object with map, map move, and map popup objects + */ +declare function quickMapMulti(options: quickMapOptions): { + map: ol.Map; + mapMove: MapMoveCls; + mapPopup: MapPopupCls; +}; +export default quickMapMulti; diff --git a/dist/olHelpers/zoomResolutionConvert.d.ts b/dist/olHelpers/zoomResolutionConvert.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a0814c97e2d920a2710dae3ebd28936c305ddeec --- /dev/null +++ b/dist/olHelpers/zoomResolutionConvert.d.ts @@ -0,0 +1,12 @@ +/** + * Get the resolution given the zoom level + * @param {number} zoomLevel - the zoom level + * @returns {number|*} the map resolution + */ +export declare function zoomToResolution(zoomLevel: any): number; +/** + * Get resolution from the zoom level + * @param {number} resolution - the resolution + * @returns {number|*} the zoom level + */ +export declare function resolutionToZoom(resolution: any): number; diff --git a/dist/util/_index.d.ts b/dist/util/_index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3bf6130661c7defd310cdb28d6a5ec14b5a80e19 --- /dev/null +++ b/dist/util/_index.d.ts @@ -0,0 +1,8 @@ +/** + * Created by gavorhes on 9/22/2016. + */ +import * as checkDefinedf from './checkDefined'; +export declare namespace checkDefined { + const undefinedOrNull: typeof checkDefinedf.undefinedOrNull; + const definedAndNotNull: typeof checkDefinedf.definedAndNotNull; +} diff --git a/dist/util/checkDefined.d.ts b/dist/util/checkDefined.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c116a08d41d227ff03a6b8a7396548d785f95f21 --- /dev/null +++ b/dist/util/checkDefined.d.ts @@ -0,0 +1,12 @@ +/** + * check if the input is undefined or null + * @param input - input pointer + * @returns true undefined or null + */ +export declare function undefinedOrNull(input: any): boolean; +/** + * check if the input is defined and not null + * @param input - input pointer + * @returns true defined and not null + */ +export declare function definedAndNotNull(input: any): boolean; diff --git a/dist/util/colors.d.ts b/dist/util/colors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3de4c8d86dc7eb0b44ae12dad0485d4711eaaa93 --- /dev/null +++ b/dist/util/colors.d.ts @@ -0,0 +1,41 @@ +/** + * converts an RGB string to hex + * @param {string} rgb - rgb color + * @returns {string} rbg as hex + */ +export declare function rgb2hex(rgb: any): string; +/** + * Convert hex string to RGB or RGBA string + * @param {string} hexString - hex color string + * @param {number} [alphaVal=undefined] Alpha value + * @returns {string} - rgb or rgba color + */ +export declare function hexAlphaToRgbOrRgba(hexString: any, alphaVal: any): string; +/** + * adds alpha value to rgb string 'rgb(r, b, g)', returns 'rgba(r, g, b, a)' + * @param {string} rgb - rgb color + * @param {number} alpha - alpha value 0 to 1 + * @returns {string} rgba color + */ +export declare function rgbToRgba(rgb: any, alpha: any): any; +/** + * @typedef {function} colorLookupByNumber + * @param {number} num - the number to use to retrieve the color + * @returns {string} rgb color + */ +/** + * Make a blue green red gradient + * @param {number} minVal - minimum value + * @param {number} maxVal - maximum value + * @param {boolean} flipColors - if the colors should be flipped + * @returns {colorLookupByNumber} color lookup function + */ +export declare function makeBlueGreenRedGradient(minVal: any, maxVal: any, flipColors: any): (theVal: any) => string; +/** + * Create a function that will return colors based on a gradient + * @param {number} median - median value + * @param {number} stdDev - standard deviation + * @param {boolean} flipColors - if the colors should be flipped + * @returns {colorLookupByNumber} color lookup function + */ +export declare function makeBlueGreenRedGradientZScore(median: any, stdDev: any, flipColors: any): (theVal: any) => string; diff --git a/dist/util/dateConvert.d.ts b/dist/util/dateConvert.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..410a41a652c3f3dc0d7fa9f65a017f9fc4b0142f --- /dev/null +++ b/dist/util/dateConvert.d.ts @@ -0,0 +1,12 @@ +/** + * Given a date return a string in the format YYYY-mm-dd hh:MM:SS + * @param {Date} dte to convert + * @returns {string} the formatted date string + */ +export declare function dateToYyyyMmDdHhMmSs(dte: Date): string; +/** + * Given a date return a string in the format YYYYmmdd_hh0000 + * @param {Date} dte the input date + * @returns {string} the formatted date string + */ +export declare function dateToYyyyMmDdHh000(dte: Date): string; diff --git a/dist/util/formatString.d.ts b/dist/util/formatString.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f237ddf58ed4ffa78778ce7f9339b647c177a932 --- /dev/null +++ b/dist/util/formatString.d.ts @@ -0,0 +1 @@ +export default undefined; diff --git a/dist/util/getUrlParams.d.ts b/dist/util/getUrlParams.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3e477e654e9c4723ba3c599e1b74c38a83c2919 --- /dev/null +++ b/dist/util/getUrlParams.d.ts @@ -0,0 +1,5 @@ +/** + * + * @returns {object} object representation of url params + */ +export default function getUrlParams(): {}; diff --git a/dist/util/makeGuid.d.ts b/dist/util/makeGuid.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e1fc4f9a9e595e68224e3cdbac0a5c04ccb9246 --- /dev/null +++ b/dist/util/makeGuid.d.ts @@ -0,0 +1,6 @@ +/** + * guids are used to uniquely identify groups and features + * @returns {string} a new guid + */ +declare function makeGuid(): string; +export default makeGuid; diff --git a/dist/util/objectHelpers.d.ts b/dist/util/objectHelpers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..668f60fa61e800a59427ac45d3800d9dbda728cc --- /dev/null +++ b/dist/util/objectHelpers.d.ts @@ -0,0 +1,15 @@ +/** + * @typedef {object} keyValuePair + * @property {string} key + * @property {object} value + */ +export interface keyVals { + key: string; + value: Object; +} +/** + * iterate over the key value pairs of an object + * @param {object} obj - the input object + * @returns {Array<keyValuePair>} - array of key value pairs + */ +export declare function keyValPairs(obj: any): keyVals[]; diff --git a/dist/util/provide.d.ts b/dist/util/provide.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d38ea8bd7e85a40c2e857d7eaaf665086bfaf5df --- /dev/null +++ b/dist/util/provide.d.ts @@ -0,0 +1,10 @@ +/** + * Created by gavorhes on 12/10/2015. + */ +/** + * create a namespace on the gv object + * @param {string} namespace to create + * @returns {object} object representing the namespace + */ +declare function provide(namespace: any): any; +export default provide; diff --git a/package.json b/package.json index 0926f5584b4a7fdd15fd294a488ad94ab0ee0c0f..b4ee0f5c926955528aa1d550bc6f1128ee31a686 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "typedoc": "typedoc --excludePrivate --mode file --out doc src", "webpack": "node_modules\\.bin\\webpack -d -w", "webpack-prod": "node_modules\\.bin\\webpack -p -w", - "tsc": "node_modules\\.bin\\tsc --rootDir .\\src --outDir ./dist", + "tsc": "node_modules\\.bin\\tsc -d --rootDir .\\src --outDir ./dist", "karma": "node_modules\\.bin\\karma start" }, "author": "TOPS Lab", diff --git a/src/olHelpers/quickMap.ts b/src/olHelpers/quickMap.ts index f2c1fe3ffa6fff45182be207f7ffd669e1f9c631..44447e6f3d52a0cb5f047f6ce73b0472e6d733ed 100644 --- a/src/olHelpers/quickMap.ts +++ b/src/olHelpers/quickMap.ts @@ -29,7 +29,6 @@ export function quickMap(options? : quickMapOptions): ol.Map { let m = quickMapBase(options); mapMove.init(m); mapPopup.init(m); - console.log('making map'); return m; }