src\Foreground.js - leaflet.ptv

API Docs for: 0.1.0
Show:

File: src\Foreground.js

  1. /**
  2. @module L.PtvLayer
  3. **/
  4. L.PtvLayer = L.PtvLayer || {};
  5.  
  6. /**
  7. Provides the PTV Foreground Layer class.
  8. @class L.PtvLayer.Foreground
  9. @extends L.PtvLayer.AbstractLayer
  10. @params {XMapClient} client XMapClient object
  11. @params {Object} options The options object
  12. @params {String} [options.format] The image format used in tile requests.
  13. @params {String} [options.beforeSend] Function to be called before sending the request with the request object given as first parameter. The (modified) request object must be returned.
  14. @constructor
  15. **/
  16. L.PtvLayer.Foreground = L.PtvLayer.AbstractOverlay.extend({
  17. initialize: function(client, options) {
  18. L.PtvLayer.AbstractOverlay.prototype.initialize.call(this, client, options);
  19. },
  20.  
  21. _getRequestObject: function() {
  22. var req = L.PtvLayer.AbstractOverlay.prototype._getRequestObject.call(this);
  23.  
  24. if(this.options.language) {
  25. req.mapParams.language = this.options.language;
  26. }
  27. req.callerContext.properties[0].value = "ajax-fg";
  28. req.callerContext.properties[1].value = "PTV_MERCATOR";
  29.  
  30. return req;
  31. }
  32. });
  33.  
  34. L.PtvLayer.foreground = function(client, options) {
  35. return new L.PtvLayer.Foreground(client, options);
  36. };
  37.