NeverTileDiscardPolicy.js 1008 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*global define*/
  2. define([], function() {
  3. "use strict";
  4. /**
  5. * A {@link TileDiscardPolicy} specifying that tile images should never be discard.
  6. *
  7. * @alias NeverTileDiscardPolicy
  8. * @constructor
  9. *
  10. * @see DiscardMissingTileImagePolicy
  11. */
  12. var NeverTileDiscardPolicy = function(options) {
  13. };
  14. /**
  15. * Determines if the discard policy is ready to process images.
  16. * @returns True if the discard policy is ready to process images; otherwise, false.
  17. */
  18. NeverTileDiscardPolicy.prototype.isReady = function() {
  19. return true;
  20. };
  21. /**
  22. * Given a tile image, decide whether to discard that image.
  23. *
  24. * @param {Image|Promise} image An image, or a promise that will resolve to an image.
  25. * @returns A promise that will resolve to true if the tile should be discarded.
  26. */
  27. NeverTileDiscardPolicy.prototype.shouldDiscardImage = function(image) {
  28. return false;
  29. };
  30. return NeverTileDiscardPolicy;
  31. });