Merge pull request #2387 from bnare/patch-1

Update mapguidesource.js
This commit is contained in:
Paul Spencer
2014-07-15 21:05:11 -04:00

View File

@@ -55,6 +55,12 @@ ol.source.MapGuide = function(options) {
*/
this.imageUrlFunction_ = imageUrlFunction;
/**
* @private
* @type {Object}
*/
this.params_ = null;
/**
* @private
* @type {boolean}
@@ -87,10 +93,27 @@ ol.source.MapGuide = function(options) {
*/
this.image_ = null;
/**
* @private
* @type {number}
*/
this.renderedRevision_ = 0;
};
goog.inherits(ol.source.MapGuide, ol.source.Image);
/**
* Get the user-provided params, i.e. those passed to the constructor through
* the "params" option, and possibly updated using the updateParams method.
* @return {Object} Params.
* @api
*/
ol.source.MapGuide.prototype.getParams = function() {
return this.params_;
};
/**
* @inheritDoc
*/
@@ -101,6 +124,7 @@ ol.source.MapGuide.prototype.getImage =
var image = this.image_;
if (!goog.isNull(image) &&
this.renderedRevision_ == this.getRevision() &&
image.getResolution() == resolution &&
image.getPixelRatio() == pixelRatio &&
ol.extent.containsExtent(image.getExtent(), extent)) {
@@ -123,6 +147,7 @@ ol.source.MapGuide.prototype.getImage =
image = null;
}
this.image_ = image;
this.renderedRevision_ = this.getRevision();
return image;
};
@@ -149,6 +174,17 @@ ol.source.MapGuide.getScale = function(extent, size, metersPerUnit, dpi) {
};
/**
* Update the user-provided params.
* @param {Object} params Params.
* @api
*/
ol.source.MapGuide.prototype.updateParams = function(params) {
goog.object.extend(this.params_, params);
this.dispatchChangeEvent();
};
/**
* @param {string} baseUrl The mapagent url.
* @param {Object.<string, string|number>} params Request parameters.