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ACjB,CAAC;IACL,CAAC;IAED,oCAAK,GAAL;QACI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA,CAAC;YACf,MAAM,CAAC,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,CAAC,iBAAM,KAAK,WAAE,CAAC;IACzB,CAAC;IAGL,2BAAC;AAAD,CAAC,AA/DD,CAA0C,+CAAsB,GA+D/D;AA/DY,oDAAoB;AAiEjC,EAAE,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;AAC/C,kBAAe,oBAAoB,CAAC","sourcesContent":["/**\r\n * Created by gavorhes on 11/13/2015.\r\n */\r\n\r\nimport {LayerBaseVectorGeoJson, LayerBaseVectorGeoJsonOptions} from './LayerBaseVectorGeoJson';\r\nimport RealEarthAnimateVector from '../mixin/RealEarthAnimateVector';\r\nimport provide from '../util/provide';\r\nimport {IRealEarthAnimate, timesLoadedCallback} from \"../mixin/RealEarthAnimate\";\r\n\r\nconst nm = provide('layers');\r\n\r\nexport interface LayerVectorRealEarthOptions extends LayerBaseVectorGeoJsonOptions {\r\n products: string;\r\n animate?: boolean;\r\n timeLoadCallback?: timesLoadedCallback;\r\n}\r\n\r\n\r\n/**\r\n * Vector real earth vector\r\n * @augments LayerBaseVectorGeoJson\r\n */\r\nexport class LayerVectorRealEarth extends LayerBaseVectorGeoJson implements IRealEarthAnimate {\r\n _products: string;\r\n animator: RealEarthAnimateVector;\r\n\r\n /**\r\n * Real Earth vector 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 * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages\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 *\r\n * @param {string} options.products real earth products identifier\r\n * @param {boolean} [options.animate=false] if the layer should be animated\r\n */\r\n constructor(options: LayerVectorRealEarthOptions) {\r\n options.animate = typeof options.animate == 'boolean' ? options.animate : false;\r\n if (options.animate) {\r\n options.autoLoad = false;\r\n super('', options);\r\n this._products = options.products;\r\n this.animator = new RealEarthAnimateVector(this, options.timeLoadCallback);\r\n this.animator.timeInit();\r\n } else {\r\n options.params = {products: options.products};\r\n super('http://realearth.ssec.wisc.edu/api/shapes', options);\r\n }\r\n }\r\n\r\n setLayerTime(theTime: number): boolean {\r\n if (this.animator) {\r\n return this.animator.setLayerTime(theTime);\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n _load(): boolean{\r\n if (this.animator){\r\n return false;\r\n }\r\n return super._load();\r\n }\r\n\r\n\r\n}\r\n\r\nnm.LayerVectorRealEarth = LayerVectorRealEarth;\r\nexport default LayerVectorRealEarth;\r\n"]}