src\Utils.js - leaflet.ptv

API Docs for: 0.1.0
Show:

File: src\Utils.js

  1. /**
  2. @module L
  3. **/
  4.  
  5. /**
  6. @class L.PtvUtils
  7. @static
  8. **/
  9. L.PtvUtils = L.PtvUtils || {};
  10.  
  11. /**
  12. Prefix map for data URIs.
  13. @attribute L.PtvUtils._prefixMap
  14. @type Object
  15. @private
  16. **/
  17. L.PtvUtils._prefixMap = {
  18. "iVBOR": "data:image/png;base64,",
  19. "R0lGO": "data:image/gif;base64,",
  20. "/9j/4": "data:image/jpeg;base64,",
  21. "Qk02U": "data:image/bmp;base64,"
  22. };
  23.  
  24. /**
  25. Returns the raw image with prefixed data URI.
  26. @method L.PtvUtils.createDataURI
  27. @return {String} the raw image with prefixed data URI.
  28. **/
  29. L.PtvUtils.createDataURI = function(rawImage) {
  30. return this._prefixMap[rawImage.substr(0, 5)] + rawImage;
  31. };
  32.