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AC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,CAAC,iBAAM,KAAK,WAAE,CAAC;IACzB,CAAC;IACL,yBAAC;AAAD,CAAC,AAnDD,CAAwC,mCAAgB,GAmDvD;AAnDY,gDAAkB;AAqD/B,EAAE,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AAC3C,kBAAe,kBAAkB,CAAC","sourcesContent":["/**\r\n * Created by gavorhes on 11/4/2015.\r\n */\r\n\r\nimport {LayerBaseXyzTile} from './LayerBaseXyzTile';\r\nimport {LayerBaseOptions} from './LayerBase';\r\nimport RealEarthAnimateTile from '../mixin/RealEarthAnimateTile';\r\nimport provide from '../util/provide';\r\nimport {IRealEarthAnimate, timesLoadedCallback} from \"../mixin/RealEarthAnimate\";\r\nconst nm = provide('layers');\r\n\r\nexport interface LayerRealEarthTileOptions extends LayerBaseOptions {\r\n products: string;\r\n animate?: boolean;\r\n timeLoadCallback?: timesLoadedCallback;\r\n}\r\n\r\n\r\n/**\r\n * Real earth tile\r\n * @augments LayerBaseXyzTile\r\n */\r\nexport class LayerRealEarthTile extends LayerBaseXyzTile implements IRealEarthAnimate {\r\n _products: string;\r\n animator: RealEarthAnimateTile;\r\n\r\n /**\r\n * The base layer for all others\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 {string} options.products - the products to request\r\n * @param {boolean} [options.hasTimes=false] If the layer is time dependent, fixed set of dates\r\n * @param {boolean} [options.animate=false] if the layer should be animated\r\n */\r\n constructor(options: LayerRealEarthTileOptions) {\r\n options.animate = typeof options.animate == 'boolean' ? options.animate : false;\r\n if (options.animate) {\r\n super('', options);\r\n this._products = options.products;\r\n this.animator = new RealEarthAnimateTile(this, options.timeLoadCallback);\r\n this.animator.timeInit();\r\n } else {\r\n super(`http://realearth.ssec.wisc.edu/api/image?products=${options.products}&x={x}&y={y}&z={z}`, options);\r\n this._products = options.products;\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\nnm.LayerRealEarthTile = LayerRealEarthTile;\r\nexport default LayerRealEarthTile;\r\n"]}