Skip to content
Snippets Groups Projects
Commit 8bbb0343 authored by Glenn Vorhes's avatar Glenn Vorhes
Browse files

modify spec files

parent 78977072
No related branches found
No related tags found
No related merge requests found
Showing
with 2098 additions and 2101 deletions
......@@ -4,11 +4,12 @@
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?: {
dataProjection: ol.ProjectionLike;
featureProjection: ol.ProjectionLike;
};
transform?: crsTransform;
mapMoveObj?: MapMoveCls;
}
/**
......@@ -17,10 +18,7 @@ export interface LayerBaseVectorGeoJsonOptions extends LayerBaseVectorOptions {
*/
export declare class LayerBaseVectorGeoJson extends LayerBaseVector {
_geoJsonFormat: ol.format.GeoJSON;
_transform: {
dataProjection: ol.ProjectionLike;
featureProjection: ol.ProjectionLike;
};
_transform: crsTransform;
/**
* @param {string|undefined|null} url - resource url, set to '' to make blank layer
* @param {object} options - config
......@@ -53,7 +51,7 @@ export declare class LayerBaseVectorGeoJson extends LayerBaseVector {
* add feature collection
* @param {object} featureCollection - as geojson object
*/
addFeatures(featureCollection: JSON): void;
addFeatures(featureCollection: any): void;
/**
* trigger load features
* @protected
......
......@@ -16,8 +16,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
var LayerBaseVector_1 = require("./LayerBaseVector");
var provide_1 = require("../util/provide");
var ol = require("custom-ol");
var proj = require("../olHelpers/projections");
var $ = require("jquery");
var proj = require("../olHelpers/projections");
var projections_1 = require("../olHelpers/projections");
var nm = provide_1.default('layers');
/**
* The Vector GeoJson Layer
......@@ -58,7 +59,9 @@ var LayerBaseVectorGeoJson = (function (_super) {
url = typeof url == 'string' ? url : '';
_this = _super.call(this, url, options) || this;
_this._geoJsonFormat = new ol.format.GeoJSON();
_this._transform = options.transform || { dataProjection: proj.proj4326, featureProjection: proj.proj3857 };
_this._transform = options.transform || {};
_this._transform.dataProjection = _this._transform.dataProjection || proj.proj4326;
_this._transform.featureProjection = _this._transform.featureProjection || projections_1.proj3857;
if (_this.autoLoad || _this.visible) {
_this._load();
}
......@@ -69,12 +72,7 @@ var LayerBaseVectorGeoJson = (function (_super) {
* @param {object} featureCollection - as geojson object
*/
LayerBaseVectorGeoJson.prototype.addFeatures = function (featureCollection) {
if (this._transform.dataProjection == 'EPSG:3857' && this._transform.featureProjection == 'EPSG:3857') {
this._source.addFeatures(this._geoJsonFormat.readFeatures(featureCollection));
}
else {
this._source.addFeatures(this._geoJsonFormat.readFeatures(featureCollection, this._transform));
}
this.source.addFeatures(this._geoJsonFormat.readFeatures(featureCollection));
};
/**
* trigger load features
......@@ -101,7 +99,7 @@ var LayerBaseVectorGeoJson = (function (_super) {
*/
LayerBaseVectorGeoJson.prototype.mapMoveCallback = function (d) {
_super.prototype.mapMoveCallback.call(this, d);
this._source.addFeatures(this._geoJsonFormat.readFeatures(d, this._transform));
this._source.addFeatures(this._geoJsonFormat.readFeatures(d, { featureProjection: this._transform.featureProjection, dataProjection: this._transform.dataProjection }));
};
return LayerBaseVectorGeoJson;
}(LayerBaseVector_1.LayerBaseVector));
......
{"version":3,"file":"LayerBaseVectorGeoJson.js","sourceRoot":"","sources":["../../src/layers/LayerBaseVectorGeoJson.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;AAEH,qDAA0E;AAC1E,2CAAsC;AACtC,8BAAiC;AAEjC,+CAAiD;AACjD,0BAA6B;AAE7B,IAAI,EAAE,GAAG,iBAAO,CAAC,QAAQ,CAAC,CAAC;AAS3B;;;GAGG;AACH;IAA4C,0CAAe;IAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gCAAY,GAAG,EAAE,OAA2C;QAA3C,wBAAA,EAAA,YAA2C;QAA5D,iBAWC;QAVG,GAAG,GAAG,OAAO,GAAG,IAAI,QAAQ,GAAG,GAA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AAI,CAAC,CAAC;QAC5B,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CACf;YACI,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACzB,CAAC,CACJ,CAAC;QAEF,MAAM,CAAC,KAAK,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACH,gDAAe,GAAf,UAAgB,CAAC;QACb,iBAAM,eAAe,YAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACnF,CAAC;IACL,6BAAC;AAAD,CAAC,AA1FD,CAA4C,iCAAe,GA0F1D;AA1FY,wDAAsB;AA4FnC,EAAE,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AACnD,kBAAe,sBAAsB,CAAC","sourcesContent":["/**\r\n * Created by gavorhes on 11/2/2015.\r\n */\r\n\r\nimport {LayerBaseVector, LayerBaseVectorOptions} from './LayerBaseVector';\r\nimport provide from '../util/provide';\r\nimport ol = require('custom-ol');\r\nimport {MapMoveCls} from \"../olHelpers/mapMoveCls\";\r\nimport * as proj from '../olHelpers/projections';\r\nimport $ = require('jquery');\r\n\r\nlet nm = provide('layers');\r\n\r\n\r\n\r\nexport interface LayerBaseVectorGeoJsonOptions extends LayerBaseVectorOptions{\r\n transform?: {dataProjection: ol.ProjectionLike, featureProjection: ol.ProjectionLike};\r\n mapMoveObj?: MapMoveCls;\r\n}\r\n\r\n/**\r\n * The Vector GeoJson Layer\r\n * @augments LayerBaseVector\r\n */\r\nexport class LayerBaseVectorGeoJson extends LayerBaseVector {\r\n _geoJsonFormat: ol.format.GeoJSON;\r\n _transform: {dataProjection: ol.ProjectionLike, featureProjection: ol.ProjectionLike};\r\n\r\n /**\r\n * @param {string|undefined|null} url - resource url, set to '' to make blank layer\r\n * @param {object} options - config\r\n * @param {string} [options.id] - layer id\r\n * @param {string} [options.name=Unnamed Layer] - layer name\r\n * @param {number} [options.opacity=1] - opacity\r\n * @param {boolean} [options.visible=true] - default visible\r\n * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28\r\n * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28\r\n * @param {object} [options.params={}] the get parameters to include to retrieve the layer\r\n * @param {number} [options.zIndex=0] the z index for the layer\r\n * @param {function} [options.loadCallback] function to call on load, context this is the layer object\r\n * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed\r\n * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility\r\n * @param {boolean} [options.legendContent] additional content to add to the legend\r\n *\r\n * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible\r\n * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined\r\n * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move\r\n * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called\r\n *\r\n * @param {object} [options.transform={}] SR transform, set as false for no transform\r\n * @param {string} options.transform.dataProjection=EPSG:4326 the data CRS\r\n * @param {string} options.transform.featureProjection=EPSG:3857 the feature/map CRS\r\n * @param {mapMoveMakeGetParams} [options.mapMoveMakeGetParams=function(lyr, extent, zoomLevel){}] function to create additional map move params\r\n * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages\r\n */\r\n constructor(url, options: LayerBaseVectorGeoJsonOptions = {}) {\r\n url = typeof url == 'string' ? url : '';\r\n super(url, options);\r\n\r\n this._geoJsonFormat = new ol.format.GeoJSON();\r\n\r\n this._transform = options.transform || {dataProjection: proj.proj4326, featureProjection: proj.proj3857};\r\n\r\n if (this.autoLoad || this.visible) {\r\n this._load();\r\n }\r\n }\r\n\r\n /**\r\n * add feature collection\r\n * @param {object} featureCollection - as geojson object\r\n */\r\n addFeatures(featureCollection: JSON) {\r\n if (this._transform.dataProjection == 'EPSG:3857' && this._transform.featureProjection == 'EPSG:3857') {\r\n this._source.addFeatures(this._geoJsonFormat.readFeatures(featureCollection));\r\n } else {\r\n this._source.addFeatures(this._geoJsonFormat.readFeatures(featureCollection, this._transform));\r\n }\r\n }\r\n\r\n /**\r\n * trigger load features\r\n * @protected\r\n * @returns {boolean} if already loaded\r\n */\r\n _load() {\r\n\r\n if (super._load()) {\r\n return true;\r\n }\r\n\r\n $.get(this._url,\r\n this._params,\r\n (d) => {\r\n this.addFeatures(d);\r\n this.loadCallback(this);\r\n }, 'json').fail(\r\n function () {\r\n this._loaded = false;\r\n }\r\n );\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * callback function on map move\r\n * @param {object} d the json response\r\n * @override\r\n */\r\n mapMoveCallback(d) {\r\n super.mapMoveCallback(d);\r\n this._source.addFeatures(this._geoJsonFormat.readFeatures(d, this._transform));\r\n }\r\n}\r\n\r\nnm.LayerBaseVectorGeoJson = LayerBaseVectorGeoJson;\r\nexport default LayerBaseVectorGeoJson;\r\n"]}
\ No newline at end of file
{"version":3,"file":"LayerBaseVectorGeoJson.js","sourceRoot":"","sources":["../../src/layers/LayerBaseVectorGeoJson.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;AAEH,qDAA0E;AAC1E,2CAAsC;AACtC,8BAAiC;AACjC,0BAA6B;AAE7B,+CAAiD;AACjD,wDAAkD;AAElD,IAAI,EAAE,GAAG,iBAAO,CAAC,QAAQ,CAAC,CAAC;AAc3B;;;GAGG;AACH;IAA4C,0CAAe;IAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gCAAY,GAAG,EAAE,OAA2C;QAA3C,wBAAA,EAAA,YAA2C;QAA5D,iBAaC;QAZG,GAAG,GAAG,OAAO,GAAG,IAAI,QAAQ,GAAG,GAAG,GAAG,EAAE,CAAC;QACxC,QAAA,kBAAM,GAAG,EAAE,OAAO,CAAC,SAAC;QAEpB,KAAI,CAAC,cAAc,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAE9C,KAAI,CAAC,UAAU,GAAG,OAA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,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,EAAC,CAAC,CAAC,CAAC;IACjH,CAAC;IACL,6BAAC;AAAD,CAAC,AA3FD,CAA4C,iCAAe,GA2F1D;AA3FY,wDAAsB;AA6FnC,EAAE,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AACnD,kBAAe,sBAAsB,CAAC","sourcesContent":["/**\r\n * Created by gavorhes on 11/2/2015.\r\n */\r\n\r\nimport {LayerBaseVector, LayerBaseVectorOptions} from './LayerBaseVector';\r\nimport provide from '../util/provide';\r\nimport ol = require('custom-ol');\r\nimport $ = require('jquery');\r\nimport {MapMoveCls} from \"../olHelpers/mapMoveCls\";\r\nimport * as proj from '../olHelpers/projections';\r\nimport {proj3857} from \"../olHelpers/projections\";\r\n\r\nlet nm = provide('layers');\r\n\r\n\r\nexport interface crsTransform {\r\n dataProjection?: ol.proj.Projection;\r\n featureProjection?: ol.proj.Projection;\r\n}\r\n\r\n\r\nexport interface LayerBaseVectorGeoJsonOptions extends LayerBaseVectorOptions {\r\n transform?: crsTransform;\r\n mapMoveObj?: MapMoveCls;\r\n}\r\n\r\n/**\r\n * The Vector GeoJson Layer\r\n * @augments LayerBaseVector\r\n */\r\nexport class LayerBaseVectorGeoJson extends LayerBaseVector {\r\n _geoJsonFormat: ol.format.GeoJSON;\r\n _transform: crsTransform;\r\n\r\n /**\r\n * @param {string|undefined|null} url - resource url, set to '' to make blank layer\r\n * @param {object} options - config\r\n * @param {string} [options.id] - layer id\r\n * @param {string} [options.name=Unnamed Layer] - layer name\r\n * @param {number} [options.opacity=1] - opacity\r\n * @param {boolean} [options.visible=true] - default visible\r\n * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28\r\n * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28\r\n * @param {object} [options.params={}] the get parameters to include to retrieve the layer\r\n * @param {number} [options.zIndex=0] the z index for the layer\r\n * @param {function} [options.loadCallback] function to call on load, context this is the layer object\r\n * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed\r\n * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility\r\n * @param {boolean} [options.legendContent] additional content to add to the legend\r\n *\r\n * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible\r\n * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined\r\n * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move\r\n * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called\r\n *\r\n * @param {object} [options.transform={}] SR transform, set as false for no transform\r\n * @param {string} options.transform.dataProjection=EPSG:4326 the data CRS\r\n * @param {string} options.transform.featureProjection=EPSG:3857 the feature/map CRS\r\n * @param {mapMoveMakeGetParams} [options.mapMoveMakeGetParams=function(lyr, extent, zoomLevel){}] function to create additional map move params\r\n * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages\r\n */\r\n constructor(url, options: LayerBaseVectorGeoJsonOptions = {}) {\r\n url = typeof url == 'string' ? url : '';\r\n super(url, options);\r\n\r\n this._geoJsonFormat = new ol.format.GeoJSON();\r\n\r\n this._transform = options.transform || {};\r\n this._transform.dataProjection = this._transform.dataProjection || proj.proj4326;\r\n this._transform.featureProjection = this._transform.featureProjection || proj3857;\r\n\r\n if (this.autoLoad || this.visible) {\r\n this._load();\r\n }\r\n }\r\n\r\n /**\r\n * add feature collection\r\n * @param {object} featureCollection - as geojson object\r\n */\r\n addFeatures(featureCollection: any) {\r\n\r\n this.source.addFeatures(this._geoJsonFormat.readFeatures(featureCollection));\r\n }\r\n\r\n\r\n /**\r\n * trigger load features\r\n * @protected\r\n * @returns {boolean} if already loaded\r\n */\r\n _load() {\r\n\r\n if (super._load()) {\r\n return true;\r\n }\r\n\r\n $.get(this._url,\r\n this._params,\r\n (d) => {\r\n this.addFeatures(d);\r\n this.loadCallback(this);\r\n }, 'json').fail(\r\n function () {\r\n this._loaded = false;\r\n }\r\n );\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * callback function on map move\r\n * @param {object} d the json response\r\n * @override\r\n */\r\n mapMoveCallback(d) {\r\n super.mapMoveCallback(d);\r\n this._source.addFeatures(this._geoJsonFormat.readFeatures(d,\r\n {featureProjection: this._transform.featureProjection, dataProjection: this._transform.dataProjection}));\r\n }\r\n}\r\n\r\nnm.LayerBaseVectorGeoJson = LayerBaseVectorGeoJson;\r\nexport default LayerBaseVectorGeoJson;\r\n"]}
\ No newline at end of file
......@@ -94,7 +94,7 @@ var RealEarthAnimateVector = (function (_super) {
* @private
*/
RealEarthAnimateVector.prototype._loadFeatures = function (geojObj) {
this._source.addFeatures(this._lyr._geoJsonFormat.readFeatures(geojObj, this._lyr._transform));
this._source.addFeatures(this._lyr._geoJsonFormat.readFeatures(geojObj, { featureProjection: this._lyr._transform.featureProjection, dataProjection: this._lyr._transform.dataProjection }));
};
RealEarthAnimateVector.prototype.setLayerTime = function (theTime) {
if (_super.prototype.setLayerTime.call(this, theTime)) {
......
{"version":3,"file":"RealEarthAnimateVector.js","sourceRoot":"","sources":["../../src/mixin/RealEarthAnimateVector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;GAEG;AACH,uDAAkD;AAClD,2CAAsC;AAGtC,0BAA6B;AAC7B,IAAM,EAAE,GAAG,iBAAO,CAAC,OAAO,CAAC,CAAC;AAG5B;;;GAGG;AACH;IAAqC,0CAAgB;IAQjD,gCAAY,KAA2B,EAAE,YAAkD;QAA3F,YACI,kBAAM,KAAK,EAAE,YAAY,CAAC,SAI7B;QAHG,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,KAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,KAAI,CAAC,IAAI,GAAG,KAAK,CAAC;;IACtB,CAAC;IAGD;;OAEG;IACH,yCAAQ,GAAR;QACI,iBAAM,QAAQ,WAAE,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC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P,QAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBACzB,QAAM,CAAC,eAAe,CAAC,QAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBACtD,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;oBACd,QAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;oBACvB,QAAM,CAAC,aAAa,CAAC,IAAI,CAAC,QAAM,EAAE,QAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5D,CAAC;YACL,CAAC,EAAE,MAAM,CACZ,CAAC;QACN,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,8CAAa,GAAb,UAAc,OAAO;QACjB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACnG,CAAC;IAED,6CAAY,GAAZ,UAAa,OAAe;QACxB,EAAE,CAAC,CAAC,iBAAM,YAAY,YAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9C,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;IACL,6BAAC;AAAD,CAAC,AAjGD,CAAqC,0BAAgB,GAiGpD;AAED,EAAE,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AACnD,kBAAe,sBAAsB,CAAC","sourcesContent":["/**\r\n * Created by gavorhes on 12/4/2015.\r\n */\r\nimport RealEarthAnimate from './RealEarthAnimate';\r\nimport provide from '../util/provide';\r\nimport ol = require('custom-ol');\r\nimport {LayerVectorRealEarth} from \"../layers/LayerRealEarthVector\";\r\nimport $ = require('jquery');\r\nconst nm = provide('mixin');\r\n\r\n\r\n/**\r\n * class mixin to animate RealEarth vector layers\r\n * @augments RealEarthAnimate\r\n */\r\nclass RealEarthAnimateVector extends RealEarthAnimate {\r\n _dataCache: Array<Array<Object>|Object>;\r\n _source: ol.source.Vector;\r\n _rawTimesLookup: {[s: string]: any};\r\n _currentIndex: number;\r\n _olLayer: ol.layer.Vector;\r\n _lyr: LayerVectorRealEarth;\r\n\r\n constructor(layer: LayerVectorRealEarth, loadCallback?: (lyr: LayerVectorRealEarth) => void){\r\n super(layer, loadCallback);\r\n this._source = layer.source;\r\n this._olLayer = layer.olLayer;\r\n this._lyr = layer;\r\n }\r\n\r\n\r\n /**\r\n * Call this after the mixin has been applied\r\n */\r\n timeInit() {\r\n super.timeInit();\r\n this._rawTimesLookup = {};\r\n this._dataCache = [];\r\n }\r\n\r\n /**\r\n * Given the raw time string, add to the arrays to keep track of dates and cache\r\n * @param {string} inString - input date string\r\n * @protected\r\n */\r\n _loadDates(inString: string): string {\r\n let rawDte = super._loadDates(inString);\r\n this._dataCache.push(null);\r\n this._rawTimesLookup[rawDte] = null;\r\n return '';\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n _loadLatest(): boolean {\r\n if (super._loadLatest()) {\r\n this._loadAtTimeIndex.call(this, this._currentIndex);\r\n }\r\n return true;\r\n }\r\n\r\n //\r\n //http://realearth.ssec.wisc.edu/api/image?products=nexrhres_20160108_212500&x=1&y=5&z=4\r\n //\r\n // 20160108.205500\r\n // http://realearth.ssec.wisc.edu/api/image?products=nexrhres_20160108_205500&x=34&y=46&z=7\r\n\r\n /**\r\n * Load the features at the date index specified\r\n * @param {number} i the index of the features to be loaded by date\r\n * @param {boolean} [setAsSource=true] set to false to trigger cache load only\r\n * @private\r\n */\r\n _loadAtTimeIndex(i: number, setAsSource = true) {\r\n setAsSource = typeof setAsSource == 'boolean' ? setAsSource : true;\r\n if (this._dataCache[i] != null) {\r\n this._source.clear();\r\n this._loadFeatures(this._dataCache[i]);\r\n } else {\r\n let __this = this;\r\n $.get('http://realearth.ssec.wisc.edu:80/api/shapes',\r\n {products: `${this._products}_${this._rawDateStrings[i]}`},\r\n function (d) {\r\n __this._dataCache[i] = d;\r\n __this._rawTimesLookup[__this._rawDateStrings[i]] = d;\r\n if (setAsSource) {\r\n __this._source.clear();\r\n __this._loadFeatures.call(__this, __this._dataCache[i]);\r\n }\r\n }, 'json'\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * helper to load the features at the index specified\r\n * @param {object} geojObj - the geojson object\r\n * @private\r\n */\r\n _loadFeatures(geojObj) {\r\n this._source.addFeatures(this._lyr._geoJsonFormat.readFeatures(geojObj, this._lyr._transform));\r\n }\r\n\r\n setLayerTime(theTime: number): boolean {\r\n if (super.setLayerTime(theTime)) {\r\n this._loadAtTimeIndex(this._currentIndex);\r\n } else {\r\n this._source.clear();\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nnm.RealEarthAnimateVector = RealEarthAnimateVector;\r\nexport default RealEarthAnimateVector;\r\n"]}
\ No newline at end of file
{"version":3,"file":"RealEarthAnimateVector.js","sourceRoot":"","sources":["../../src/mixin/RealEarthAnimateVector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;GAEG;AACH,uDAAkD;AAClD,2CAAsC;AAGtC,0BAA6B;AAC7B,IAAM,EAAE,GAAG,iBAAO,CAAC,OAAO,CAAC,CAAC;AAG5B;;;GAGG;AACH;IAAqC,0CAAgB;IAQjD,gCAAY,KAA2B,EAAE,YAAkD;QAA3F,YACI,kBAAM,KAAK,EAAE,YAAY,CAAC,SAI7B;QAHG,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,KAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,KAAI,CAAC,IAAI,GAAG,KAAK,CAAC;;IACtB,CAAC;IAGD;;OAEG;IACH,yCAAQ,GAAR;QACI,iBAAM,QAAQ,WAAE,CAAC;QACjB,IA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2015.\r\n */\r\nimport RealEarthAnimate from './RealEarthAnimate';\r\nimport provide from '../util/provide';\r\nimport ol = require('custom-ol');\r\nimport {LayerVectorRealEarth} from \"../layers/LayerRealEarthVector\";\r\nimport $ = require('jquery');\r\nconst nm = provide('mixin');\r\n\r\n\r\n/**\r\n * class mixin to animate RealEarth vector layers\r\n * @augments RealEarthAnimate\r\n */\r\nclass RealEarthAnimateVector extends RealEarthAnimate {\r\n _dataCache: Array<Array<Object>|Object>;\r\n _source: ol.source.Vector;\r\n _rawTimesLookup: {[s: string]: any};\r\n _currentIndex: number;\r\n _olLayer: ol.layer.Vector;\r\n _lyr: LayerVectorRealEarth;\r\n\r\n constructor(layer: LayerVectorRealEarth, loadCallback?: (lyr: LayerVectorRealEarth) => void){\r\n super(layer, loadCallback);\r\n this._source = layer.source;\r\n this._olLayer = layer.olLayer;\r\n this._lyr = layer;\r\n }\r\n\r\n\r\n /**\r\n * Call this after the mixin has been applied\r\n */\r\n timeInit() {\r\n super.timeInit();\r\n this._rawTimesLookup = {};\r\n this._dataCache = [];\r\n }\r\n\r\n /**\r\n * Given the raw time string, add to the arrays to keep track of dates and cache\r\n * @param {string} inString - input date string\r\n * @protected\r\n */\r\n _loadDates(inString: string): string {\r\n let rawDte = super._loadDates(inString);\r\n this._dataCache.push(null);\r\n this._rawTimesLookup[rawDte] = null;\r\n return '';\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n _loadLatest(): boolean {\r\n if (super._loadLatest()) {\r\n this._loadAtTimeIndex.call(this, this._currentIndex);\r\n }\r\n return true;\r\n }\r\n\r\n //\r\n //http://realearth.ssec.wisc.edu/api/image?products=nexrhres_20160108_212500&x=1&y=5&z=4\r\n //\r\n // 20160108.205500\r\n // http://realearth.ssec.wisc.edu/api/image?products=nexrhres_20160108_205500&x=34&y=46&z=7\r\n\r\n /**\r\n * Load the features at the date index specified\r\n * @param {number} i the index of the features to be loaded by date\r\n * @param {boolean} [setAsSource=true] set to false to trigger cache load only\r\n * @private\r\n */\r\n _loadAtTimeIndex(i: number, setAsSource = true) {\r\n setAsSource = typeof setAsSource == 'boolean' ? setAsSource : true;\r\n if (this._dataCache[i] != null) {\r\n this._source.clear();\r\n this._loadFeatures(this._dataCache[i]);\r\n } else {\r\n let __this = this;\r\n $.get('http://realearth.ssec.wisc.edu:80/api/shapes',\r\n {products: `${this._products}_${this._rawDateStrings[i]}`},\r\n function (d) {\r\n __this._dataCache[i] = d;\r\n __this._rawTimesLookup[__this._rawDateStrings[i]] = d;\r\n if (setAsSource) {\r\n __this._source.clear();\r\n __this._loadFeatures.call(__this, __this._dataCache[i]);\r\n }\r\n }, 'json'\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * helper to load the features at the index specified\r\n * @param {object} geojObj - the geojson object\r\n * @private\r\n */\r\n _loadFeatures(geojObj) {\r\n this._source.addFeatures(this._lyr._geoJsonFormat.readFeatures(geojObj,\r\n {featureProjection: this._lyr._transform.featureProjection, dataProjection: this._lyr._transform.dataProjection}));\r\n }\r\n\r\n setLayerTime(theTime: number): boolean {\r\n if (super.setLayerTime(theTime)) {\r\n this._loadAtTimeIndex(this._currentIndex);\r\n } else {\r\n this._source.clear();\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nnm.RealEarthAnimateVector = RealEarthAnimateVector;\r\nexport default RealEarthAnimateVector;\r\n"]}
\ No newline at end of file
......@@ -9,18 +9,25 @@ module.exports = function (config) {
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'source-map-support'],
frameworks: ['jasmine', 'karma-typescript'],
// list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/custom-ol/lib/index.js',
'spec/build/**/*.js',
{
pattern: 'spec/build/**/*.js.map',
included: false
},
{pattern: 'node_modules/jquery/dist/jquery.min.js', watched: false},
{pattern: 'node_modules/custom-ol/lib/index.js', watched: false},
{pattern: 'spec/**/*.ts', watched: false},
// {pattern: 'spec/**/*.js.map', watched: false},
// 'spec/build/**/*.js',
// {
// pattern: 'spec/build/**/*.js.map',
// included: false
// },
// {
// pattern: 'dist/**/*.js',
// included: false
// },
// 'spec/**/*.ts',
// 'src/**/*.ts'
],
......@@ -33,43 +40,41 @@ module.exports = function (config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
// 'spec/build/**/*.js': ['sourcemap']
'spec/**/*.ts': ["karma-typescript", 'webpack', 'sourcemap'],
},
// webpack: {
// // karma watches the test entry points
// // (you don't need to specify the entry option)
// // webpack watches dependencies
//
// // webpack configuration
// debug: true,
// devtool: 'inline-source-map',
// module: {
// loaders: [
// {test: /\.js$/, loader: "source-map-loader"}
// ]
// },
// externals: {
// "jquery": "$",
// "custom-ol": "ol",
// "react": "React",
// "react-dom": "ReactDOM"
// }
// },
//
// webpackMiddleware: {
// // webpack-dev-middleware configuration
// // i. e.
// stats: {
// colors: true
// }
// },
webpack: {
// karma watches the test entry points
// (you don't need to specify the entry option)
// webpack watches dependencies
// webpack configuration
// debug: true,
// devtool: 'source-map',
// module: {
// loaders: [
// {test: /\.js$/, loader: "source-map-loader"}
// ]
// },
externals: {
"jquery": "$",
"custom-ol": "ol",
"react": "React",
"react-dom": "ReactDOM"
}
},
webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
stats: 'errors-only'
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
reporters: ['progress', "karma-typescript"],
// web server port
......@@ -82,11 +87,13 @@ module.exports = function (config) {
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_ERROR,
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
autoWatch: false,
autoWatchBatchDelay: 100,
// start these browsers
......
......@@ -31,12 +31,17 @@
"expect": "^1.20.1",
"jasmine": "^2.5.3",
"jasmine-core": "^2.5.2",
"karma": "^1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-jasmine": "^1.1.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^2.1.7",
"karma-webpack": "^2.0.2",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"source-map-loader": "^0.1.5",
"ts-loader": "^0.8.2"
"ts-loader": "^0.8.2",
"typescript": "^2.2.1"
},
"repository": {
"type": "git",
......
......@@ -45,592 +45,24 @@
/*!*********************************!*\
!*** ./layers/LayerBaseSpec.js ***!
\*********************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Created by glenn on 3/8/2017.
*/
"use strict";
var LayerBase_1 = __webpack_require__(/*! ../../dist/layers/LayerBase */ 3);
describe("Layer Base", function () {
it('exists', function () {
expect(LayerBase_1.LayerBase).toBeDefined();
});
});
/***/ },
/* 1 */,
/* 2 */,
/* 3 */
/*!***********************************!*\
!*** ../dist/layers/LayerBase.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var zoomResolutionConvert = __webpack_require__(/*! ../olHelpers/zoomResolutionConvert */ 4);
var provide_1 = __webpack_require__(/*! ../util/provide */ 5);
var makeGuid_1 = __webpack_require__(/*! ../util/makeGuid */ 6);
var $ = __webpack_require__(/*! jquery */ 7);
var nm = provide_1.default('layers');
/**
* The base layer class
* @abstract
*/
var LayerBase = (function () {
/**
* 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
*/
function LayerBase(url, options) {
if (options === void 0) { options = {}; }
options = options || {};
if (typeof url !== 'string') {
throw 'Invalid URL';
}
this._url = url;
this._params = typeof options.params == 'object' ? options.params : {};
this._legendCollapse = typeof options.legendCollapse == 'boolean' ? options.legendCollapse : false;
this._legendCheckbox = typeof options.legendCheckbox == 'boolean' ? options.legendCheckbox : true;
this.id = options.id || makeGuid_1.default();
this._name = options.name || 'Unnamed Layer';
this.animate = false;
this._opacity = typeof options.opacity == 'number' ? options.opacity : 1;
if (this._opacity > 1) {
this._opacity = 1;
}
else if (this._opacity < 0) {
this._opacity = 0;
}
this._visible = typeof options.visible === 'boolean' ? options.visible : true;
this._source = undefined;
/**
*
* @protected
*/
this._olLayer = undefined;
this._loaded = false;
this._maxResolution = zoomResolutionConvert.zoomToResolution(options.minZoom);
if (typeof this._maxResolution !== 'undefined') {
this._maxResolution += 0.00001;
}
this._minResolution = zoomResolutionConvert.zoomToResolution(options.maxZoom);
this._minZoom = typeof options.minZoom == 'number' ? options.minZoom : undefined;
this._maxZoom = typeof options.maxZoom == 'number' ? options.maxZoom : undefined;
this._zIndex = typeof options.zIndex == 'number' ? options.zIndex : 0;
this.loadCallback = typeof options.loadCallback == 'function' ? options.loadCallback : function () {
};
this._legendContent = '';
if (this._legendCheckbox) {
this._legendContent += "<input type=\"checkbox\" " + (this.visible ? 'checked' : '') + " " +
("class=\"legend-check\" id=\"" + this.id + "-legend-layer-check\"><span></span>");
this._legendContent += "<label for=\"" + this.id + "-legend-layer-check\" class=\"legend-layer-name\">" + this.name + "</label>";
}
else {
this._legendContent += "<label class=\"legend-layer-name\">" + this.name + "</label>";
}
this._$legendDiv = null;
this._applyCollapseCalled = false;
this._addLegendContent(typeof options.legendContent === 'string' ? options.legendContent : undefined);
}
/**
* base load function, sets _loaded = true if it is not already
* @protected
* @returns {boolean} if already loaded
*/
LayerBase.prototype._load = function () {
if (this.loaded == true) {
return true;
}
else {
this._loaded = true;
return false;
}
};
/**
* Get the legend html, be sure to only add to the DOM once
* @returns {string} html for layer wrapped in a div
*/
LayerBase.prototype.getLegendDiv = function () {
return "<div class=\"legend-layer-div\" id=\"" + this.id + "-legend-layer-div\">" + this._legendContent + "</div>";
};
/**
*
* @param additionalContent - additional content to add to legend
* @private
*/
LayerBase.prototype._addLegendContent = function (additionalContent) {
if (additionalContent === void 0) { additionalContent = ''; }
var addCollapse = additionalContent.indexOf('<ul>') > -1;
if (addCollapse) {
additionalContent = '<span class="legend-items-expander" title="Expand/Collapse">&#9660;</span>' + additionalContent;
}
this._legendContent += additionalContent;
this._$legendDiv = $("#" + this.id + "-legend-layer-div");
if (this._$legendDiv.length > 0) {
this._$legendDiv.append(additionalContent);
this.applyCollapse();
}
};
/**
* add additional content to the legend
* @param {string} [additionalContent=] - additonal content to add
*/
LayerBase.prototype.addLegendContent = function (additionalContent) {
this._addLegendContent(additionalContent);
};
LayerBase.prototype.applyCollapse = function () {
if (this._applyCollapseCalled) {
console.log('collapse already applied');
return undefined;
}
this._$legendDiv = $("#" + this.id + "-legend-layer-div");
if (this._$legendDiv.length > 0) {
var $expander = this._$legendDiv.find('.legend-items-expander');
if ($expander.length > 0) {
this._applyCollapseCalled = true;
$expander.click(function () {
var $this = $(this);
$this.siblings('ul').slideToggle();
if ($this.hasClass('legend-layer-group-collapsed')) {
$this.removeClass('legend-layer-group-collapsed');
$this.html('&#9660;');
}
else {
$this.addClass('legend-layer-group-collapsed');
$this.html('&#9654;');
}
});
if (this._legendCollapse) {
$expander.trigger('click');
}
}
}
};
/**
* trick to refresh the layer
*/
LayerBase.prototype.refresh = function () {
if (this.source) {
this.source.refresh();
}
};
Object.defineProperty(LayerBase.prototype, "id", {
get: function () {
return this._id;
},
set: function (newId) {
this._id = newId;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "animate", {
get: function () {
return this._animate;
},
set: function (animate) {
this._animate = animate;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "legendContent", {
/**
* get the legend content
* @type {string}
*/
get: function () {
return this._legendContent;
},
/**
* set the legend content directly
* @param {string} newVal - new content
* @protected
*/
set: function (newVal) {
this._legendContent = newVal;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "params", {
/**
* get the map get params
* @type {object}
*/
get: function () {
return this._params;
},
/**
* set the map get params
* @param {object} newParams - new get params
* @protected
*/
set: function (newParams) {
this._params = newParams;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "minResolution", {
/**
* get the minimum resolution
* @type {number|*}
*/
get: function () {
return this._minResolution;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "maxResolution", {
/**
* get the maximum resolution
* @type {number|*}
*/
get: function () {
return this._maxResolution;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "minZoom", {
/**
* get min zoom
* @type {number|*}
*/
get: function () {
return this._minZoom;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "maxZoom", {
/**
* get max zoom
* @type {number|*}
*/
get: function () {
return this._maxZoom;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "url", {
/**
* get the url
* @type {string}
*/
get: function () {
return this._url;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "visible", {
/**
* Get the layer visibility
* @type {boolean}
*/
get: function () {
return this._visible;
},
/**
* set the visibility
* @param visibility
*/
set: function (visibility) {
this.setVisible(visibility);
},
enumerable: true,
configurable: true
});
LayerBase.prototype.setVisible = function (visibility) {
this._visible = visibility;
if (this.olLayer) {
this.olLayer.setVisible(this._visible);
if (visibility && !this._loaded) {
this._load();
}
}
};
Object.defineProperty(LayerBase.prototype, "opacity", {
/**
* Get the layer opacity
* @type {number}
*/
get: function () {
return this._opacity;
},
/**
* Set the layer opacity
* @param {number} opacity - layer opacity
*/
set: function (opacity) {
this._opacity = opacity;
if (this.olLayer) {
this.olLayer.setOpacity(this._opacity);
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "name", {
/**
* Get the layer name
* @type {string}
*/
get: function () {
return this._name;
},
/**
* set the layer name
* @param {string} newName - the new name
*/
set: function (newName) {
this._name = newName;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "loaded", {
/**
* Check if the layer is loaded
* @type {boolean}
*/
get: function () {
return this._loaded;
},
enumerable: true,
configurable: true
});
Object.defineProperty(LayerBase.prototype, "source", {
/**
* get the layer source
* @type {*}
*/
get: function () {
return this.getSource();
},
enumerable: true,
configurable: true
});
LayerBase.prototype.getSource = function () {
return this._source;
};
Object.defineProperty(LayerBase.prototype, "zIndex", {
/**
* get the z index
*/
get: function () {
return this._zIndex;
},
/**
* set the z index
*/
set: function (newZ) {
this._zIndex = newZ;
},
enumerable: true,
configurable: true
});
LayerBase.prototype.setZIndex = function (newZ) {
};
Object.defineProperty(LayerBase.prototype, "olLayer", {
/**
* the the ol layer
*/
get: function () {
return this.getOlLayer();
},
enumerable: true,
configurable: true
});
LayerBase.prototype.getOlLayer = function () {
return this._olLayer;
};
return LayerBase;
}());
exports.LayerBase = LayerBase;
nm.LayerBase = LayerBase;
exports.default = LayerBase;
/***/ },
/* 4 */
/*!**************************************************!*\
!*** ../dist/olHelpers/zoomResolutionConvert.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Created by gavorhes on 12/14/2015.
*/
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var provide_1 = __webpack_require__(/*! ../util/provide */ 5);
var nm = provide_1.default('olHelpers.zoomResolutionConvert');
var _zoomResLookup = [
156543.03392804097,
78271.51696402048,
39135.75848201024,
19567.87924100512,
9783.93962050256,
4891.96981025128,
2445.98490512564,
1222.99245256282,
611.49622628141,
305.748113140705,
152.8740565703525,
76.43702828517625,
38.21851414258813,
19.109257071294063,
9.554628535647032,
4.777314267823516,
2.388657133911758,
1.194328566955879,
0.5971642834779395,
0.29858214173896974,
0.14929107086948487,
0.07464553543474244,
0.03732276771737122,
0.01866138385868561,
0.009330691929342804,
0.004665345964671402,
0.002332672982335701,
0.0011663364911678506,
0.0005831682455839253 //28
];
/**
* Get the resolution given the zoom level
* @param {number} zoomLevel - the zoom level
* @returns {number|*} the map resolution
*/
function zoomToResolution(zoomLevel) {
"use strict";
if (typeof zoomLevel == 'number') {
if (zoomLevel % 1 === 0 && zoomLevel >= 0 && zoomLevel <= 28) {
return _zoomResLookup[zoomLevel];
}
else {
console.log("invalid zoom level provided: " + zoomLevel);
return undefined;
}
}
else {
return undefined;
}
}
exports.zoomToResolution = zoomToResolution;
nm.zoomToResolution = zoomToResolution;
/**
* Get resolution from the zoom level
* @param {number} resolution - the resolution
* @returns {number|*} the zoom level
*/
function resolutionToZoom(resolution) {
for (var i = 0; i < _zoomResLookup.length; i++) {
if (resolution >= _zoomResLookup[i]) {
return i;
}
}
return 0;
}
exports.resolutionToZoom = resolutionToZoom;
nm.resolutionToZoom = resolutionToZoom;
/***/ },
/* 5 */
/*!*******************************!*\
!*** ../dist/util/provide.js ***!
\*******************************/
/***/ function(module, exports) {
/**
* Created by gavorhes on 12/10/2015.
*/
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* create a namespace on the gv object
* @param {string} namespace to create
* @returns {object} object representing the namespace
*/
function provide(namespace) {
"use strict";
if (typeof window['gv'] == 'undefined') {
window['gv'] = {};
}
var parts = namespace.split('.');
var nameSpace = window['gv'];
for (var i = 0; i < parts.length; i++) {
var newObject = nameSpace[parts[i]];
if (typeof newObject == 'undefined') {
nameSpace[parts[i]] = {};
}
nameSpace = nameSpace[parts[i]];
}
return nameSpace;
}
provide('util');
window['gv'].util.provide = provide;
exports.default = provide;
/***/ },
/* 6 */
/*!********************************!*\
!*** ../dist/util/makeGuid.js ***!
\********************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Created by gavorhes on 11/3/2015.
*/
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var provide_1 = __webpack_require__(/*! ./provide */ 5);
var nm = provide_1.default('util');
/**
* guids are used to uniquely identify groups and features
* @returns {string} a new guid
*/
function makeGuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;
return v.toString(16);
});
}
nm.makeGuid = makeGuid;
exports.default = makeGuid;
/***/ },
/* 7 */
/*!********************!*\
!*** external "$" ***!
\********************/
/***/ function(module, exports) {
// /**
// * Created by glenn on 3/8/2017.
// */
//
// import {LayerBase, LayerBaseOptions} from '../../dist/layers/LayerBase';
//
// describe("Layer Base", function () {
//
// it('exists', function () {
// expect(LayerBase).toBeDefined()
//
// })
//
//
// });
module.exports = $;
/***/ }
/******/ ]);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -59,6 +59,7 @@
console.log('here');
console.log('here');
expect(1).toBeGreaterThan(0);
expect(1).toBeGreaterThan(1);
});
});
......
{"version":3,"sources":["webpack:///webpack/bootstrap 6f24556dfd0483c75bde?27ed*","webpack:///./newSpec2.ts"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;ACtCA;;IAEG;AAIH,gCAA+B;AAE/B,SAAQ,CAAC,OAAO,EAAE;KAEd,EAAE,CAAC,YAAY,EAAE;SAEb,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC,CAAC;KAEH,EAAE,CAAC,QAAQ,EAAE;SACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACrB,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC;AACN,EAAC,CAAC,CAAC","file":"newSpec2.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 6f24556dfd0483c75bde","/**\r\n * Created by glenn on 3/8/2017.\r\n */\r\n\r\n\r\n\r\n// var d = require('custom-ol')\r\n\r\ndescribe('a cat', function () {\r\n\r\n it('should eat', function () {\r\n\r\n expect(1).toBeGreaterThan(0)\r\n });\r\n\r\n it('my car', function () {\r\n console.log('here');\r\n console.log('here');\r\n expect(1).toBeGreaterThan(0);\r\n })\r\n});\n\n\n// WEBPACK FOOTER //\n// ./newSpec2.ts"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap c5a0503caed534747b5e?7d3d**","webpack:///./newSpec2.ts"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;ACtCA;;IAEG;AAIH,gCAA+B;AAE/B,SAAQ,CAAC,OAAO,EAAE;KAEd,EAAE,CAAC,YAAY,EAAE;SAEb,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC,CAAC;KAEH,EAAE,CAAC,QAAQ,EAAE;SACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACrB,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;SAC7B,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC;AACN,EAAC,CAAC,CAAC","file":"newSpec2.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c5a0503caed534747b5e","/**\r\n * Created by glenn on 3/8/2017.\r\n */\r\n\r\n\r\n\r\n// var d = require('custom-ol')\r\n\r\ndescribe('a cat', function () {\r\n\r\n it('should eat', function () {\r\n\r\n expect(1).toBeGreaterThan(0)\r\n });\r\n\r\n it('my car', function () {\r\n console.log('here');\r\n console.log('here');\r\n expect(1).toBeGreaterThan(0);\r\n expect(1).toBeGreaterThan(1);\r\n })\r\n});\n\n\n// WEBPACK FOOTER //\n// ./newSpec2.ts"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap 27d78118ac35ccd99f6c","webpack:///./newSpec3.ts"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;ACtCA;;IAEG;AAGH,gCAA+B;AAE/B,SAAQ,CAAC,OAAO,EAAE;KAEd,EAAE,CAAC,YAAY,EAAE;SAEb,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC,CAAC;KAEH,EAAE,CAAC,QAAQ,EAAE;SACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACrB,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC,CAAC;KAEH,EAAE,CAAC,gBAAgB,EAAE;SACjB,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;KAC9B,CAAC,CAAC;AACN,EAAC,CAAC,CAAC","file":"newSpec3.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 27d78118ac35ccd99f6c","/**\r\n * Created by glenn on 3/8/2017.\r\n */\r\n\r\n\r\n// var d = require('custom-ol')\r\n\r\ndescribe('a cat', function () {\r\n\r\n it('should eat', function () {\r\n\r\n expect(1).toBeGreaterThan(0)\r\n });\r\n\r\n it('my car', function () {\r\n console.log('here');\r\n console.log('here');\r\n expect(1).toBeGreaterThan(0);\r\n });\r\n\r\n it('eats that fish', function () {\r\n expect(true).toBeTruthy();\r\n })\r\n});\n\n\n// WEBPACK FOOTER //\n// ./newSpec3.ts"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap c5a0503caed534747b5e?7d3d***","webpack:///./newSpec3.ts"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;ACtCA;;IAEG;AAGH,gCAA+B;AAE/B,SAAQ,CAAC,OAAO,EAAE;KAEd,EAAE,CAAC,YAAY,EAAE;SAEb,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC,CAAC;KAEH,EAAE,CAAC,QAAQ,EAAE;SACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACrB,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;KAChC,CAAC,CAAC,CAAC;KAEH,EAAE,CAAC,gBAAgB,EAAE;SACjB,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;KAC9B,CAAC,CAAC;AACN,EAAC,CAAC,CAAC","file":"newSpec3.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c5a0503caed534747b5e","/**\r\n * Created by glenn on 3/8/2017.\r\n */\r\n\r\n\r\n// var d = require('custom-ol')\r\n\r\ndescribe('a cat', function () {\r\n\r\n it('should eat', function () {\r\n\r\n expect(1).toBeGreaterThan(0)\r\n });\r\n\r\n it('my car', function () {\r\n console.log('here');\r\n console.log('here');\r\n expect(1).toBeGreaterThan(0);\r\n });\r\n\r\n it('eats that fish', function () {\r\n expect(true).toBeTruthy();\r\n })\r\n});\n\n\n// WEBPACK FOOTER //\n// ./newSpec3.ts"],"sourceRoot":""}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Created by glenn on 3/8/2017.
*/
"use strict";
var LayerBase_1 = require("../../dist/layers/LayerBase");
describe("Layer Base", function () {
it('exists', function () {
expect(LayerBase_1.LayerBase).toBeDefined();
});
});
// /**
// * Created by glenn on 3/8/2017.
// */
//
// import {LayerBase, LayerBaseOptions} from '../../dist/layers/LayerBase';
//
// describe("Layer Base", function () {
//
// it('exists', function () {
// expect(LayerBase).toBeDefined()
//
// })
//
//
// });
//# sourceMappingURL=LayerBaseSpec.js.map
\ No newline at end of file
{"version":3,"file":"LayerBaseSpec.js","sourceRoot":"","sources":["LayerBaseSpec.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,yDAAwE;AAExE,QAAQ,CAAC,YAAY,EAAE;IAEnB,EAAE,CAAC,QAAQ,EAAE;QACT,MAAM,CAAC,qBAAS,CAAC,CAAC,WAAW,EAAE,CAAA;IAEnC,CAAC,CAAC,CAAA;AAGN,CAAC,CAAC,CAAC"}
\ No newline at end of file
{"version":3,"file":"LayerBaseSpec.js","sourceRoot":"","sources":["LayerBaseSpec.ts"],"names":[],"mappings":"AAAA,MAAM;AACN,mCAAmC;AACnC,MAAM;AACN,EAAE;AACF,2EAA2E;AAC3E,EAAE;AACF,uCAAuC;AACvC,EAAE;AACF,iCAAiC;AACjC,0CAA0C;AAC1C,EAAE;AACF,SAAS;AACT,EAAE;AACF,EAAE;AACF,MAAM"}
\ No newline at end of file
/**
* Created by glenn on 3/8/2017.
*/
import {LayerBase, LayerBaseOptions} from '../../dist/layers/LayerBase';
describe("Layer Base", function () {
it('exists', function () {
expect(LayerBase).toBeDefined()
})
});
\ No newline at end of file
// /**
// * Created by glenn on 3/8/2017.
// */
//
// import {LayerBase, LayerBaseOptions} from '../../dist/layers/LayerBase';
//
// describe("Layer Base", function () {
//
// it('exists', function () {
// expect(LayerBase).toBeDefined()
//
// })
//
//
// });
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment