Rename ol.source.MapGuide to ol.source.ImageMapGuide

This commit is contained in:
Éric Lemoine
2014-08-19 09:44:15 +02:00
parent 711c4bbc8c
commit ec81c05cce
3 changed files with 23 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.layer.Image'); goog.require('ol.layer.Image');
goog.require('ol.source.MapGuide'); goog.require('ol.source.ImageMapGuide');
var mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition'; var mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
var agentUrl = var agentUrl =
@@ -16,7 +16,7 @@ var map = new ol.Map({
layers: [ layers: [
new ol.layer.Image({ new ol.layer.Image({
extent: bounds, extent: bounds,
source: new ol.source.MapGuide({ source: new ol.source.ImageMapGuide({
projection: 'EPSG:4326', projection: 'EPSG:4326',
url: agentUrl, url: agentUrl,
useOverlay: false, useOverlay: false,

View File

@@ -3269,28 +3269,28 @@ olx.source.IGCOptions.prototype.urls;
* params: (Object|undefined)}} * params: (Object|undefined)}}
* @api * @api
*/ */
olx.source.MapGuideOptions; olx.source.ImageMapGuideOptions;
/** /**
* The mapagent url. * The mapagent url.
* @type {string|undefined} * @type {string|undefined}
*/ */
olx.source.MapGuideOptions.prototype.url; olx.source.ImageMapGuideOptions.prototype.url;
/** /**
* The display resolution. Default is `96`. * The display resolution. Default is `96`.
* @type {number|undefined} * @type {number|undefined}
*/ */
olx.source.MapGuideOptions.prototype.displayDpi; olx.source.ImageMapGuideOptions.prototype.displayDpi;
/** /**
* The meters-per-unit value. Default is `1`. * The meters-per-unit value. Default is `1`.
* @type {number|undefined} * @type {number|undefined}
*/ */
olx.source.MapGuideOptions.prototype.metersPerUnit; olx.source.ImageMapGuideOptions.prototype.metersPerUnit;
/** /**
@@ -3298,21 +3298,21 @@ olx.source.MapGuideOptions.prototype.metersPerUnit;
* server. Default is `true`. * server. Default is `true`.
* @type {boolean|undefined} * @type {boolean|undefined}
*/ */
olx.source.MapGuideOptions.prototype.hidpi; olx.source.ImageMapGuideOptions.prototype.hidpi;
/** /**
* If `true`, will use `GETDYNAMICMAPOVERLAYIMAGE`. * If `true`, will use `GETDYNAMICMAPOVERLAYIMAGE`.
* @type {boolean|undefined} * @type {boolean|undefined}
*/ */
olx.source.MapGuideOptions.prototype.useOverlay; olx.source.ImageMapGuideOptions.prototype.useOverlay;
/** /**
* Projection. * Projection.
* @type {ol.proj.ProjectionLike} * @type {ol.proj.ProjectionLike}
*/ */
olx.source.MapGuideOptions.prototype.projection; olx.source.ImageMapGuideOptions.prototype.projection;
/** /**
@@ -3320,21 +3320,21 @@ olx.source.MapGuideOptions.prototype.projection;
* twice the size of the map viewport, and so on. Default is `1`. * twice the size of the map viewport, and so on. Default is `1`.
* @type {number|undefined} * @type {number|undefined}
*/ */
olx.source.MapGuideOptions.prototype.ratio; olx.source.ImageMapGuideOptions.prototype.ratio;
/** /**
* Resolutions. If specified, requests will be made for these resolutions only. * Resolutions. If specified, requests will be made for these resolutions only.
* @type {Array.<number>|undefined} * @type {Array.<number>|undefined}
*/ */
olx.source.MapGuideOptions.prototype.resolutions; olx.source.ImageMapGuideOptions.prototype.resolutions;
/** /**
* Additional parameters. * Additional parameters.
* @type {Object|undefined} * @type {Object|undefined}
*/ */
olx.source.MapGuideOptions.prototype.params; olx.source.ImageMapGuideOptions.prototype.params;
/** /**

View File

@@ -1,4 +1,4 @@
goog.provide('ol.source.MapGuide'); goog.provide('ol.source.ImageMapGuide');
goog.require('goog.object'); goog.require('goog.object');
goog.require('goog.uri.utils'); goog.require('goog.uri.utils');
@@ -15,10 +15,10 @@ goog.require('ol.source.Image');
* *
* @constructor * @constructor
* @extends {ol.source.Image} * @extends {ol.source.Image}
* @param {olx.source.MapGuideOptions} options Options. * @param {olx.source.ImageMapGuideOptions} options Options.
* @api * @api
*/ */
ol.source.MapGuide = function(options) { ol.source.ImageMapGuide = function(options) {
goog.base(this, { goog.base(this, {
projection: options.projection, projection: options.projection,
@@ -98,7 +98,7 @@ ol.source.MapGuide = function(options) {
this.renderedRevision_ = 0; this.renderedRevision_ = 0;
}; };
goog.inherits(ol.source.MapGuide, ol.source.Image); goog.inherits(ol.source.ImageMapGuide, ol.source.Image);
/** /**
@@ -107,7 +107,7 @@ goog.inherits(ol.source.MapGuide, ol.source.Image);
* @return {Object} Params. * @return {Object} Params.
* @api * @api
*/ */
ol.source.MapGuide.prototype.getParams = function() { ol.source.ImageMapGuide.prototype.getParams = function() {
return this.params_; return this.params_;
}; };
@@ -115,7 +115,7 @@ ol.source.MapGuide.prototype.getParams = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
ol.source.MapGuide.prototype.getImage = ol.source.ImageMapGuide.prototype.getImage =
function(extent, resolution, pixelRatio, projection) { function(extent, resolution, pixelRatio, projection) {
resolution = this.findNearestResolution(resolution); resolution = this.findNearestResolution(resolution);
pixelRatio = this.hidpi_ ? pixelRatio : 1; pixelRatio = this.hidpi_ ? pixelRatio : 1;
@@ -158,7 +158,7 @@ ol.source.MapGuide.prototype.getImage =
* @param {number} dpi The display resolution. * @param {number} dpi The display resolution.
* @return {number} The computed map scale. * @return {number} The computed map scale.
*/ */
ol.source.MapGuide.getScale = function(extent, size, metersPerUnit, dpi) { ol.source.ImageMapGuide.getScale = function(extent, size, metersPerUnit, dpi) {
var mcsW = ol.extent.getWidth(extent); var mcsW = ol.extent.getWidth(extent);
var mcsH = ol.extent.getHeight(extent); var mcsH = ol.extent.getHeight(extent);
var devW = size[0]; var devW = size[0];
@@ -177,7 +177,7 @@ ol.source.MapGuide.getScale = function(extent, size, metersPerUnit, dpi) {
* @param {Object} params Params. * @param {Object} params Params.
* @api * @api
*/ */
ol.source.MapGuide.prototype.updateParams = function(params) { ol.source.ImageMapGuide.prototype.updateParams = function(params) {
goog.object.extend(this.params_, params); goog.object.extend(this.params_, params);
this.dispatchChangeEvent(); this.dispatchChangeEvent();
}; };
@@ -191,16 +191,16 @@ ol.source.MapGuide.prototype.updateParams = function(params) {
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @return {string} The mapagent map image request URL. * @return {string} The mapagent map image request URL.
*/ */
ol.source.MapGuide.prototype.getUrl = ol.source.ImageMapGuide.prototype.getUrl =
function(baseUrl, params, extent, size, projection) { function(baseUrl, params, extent, size, projection) {
var scale = ol.source.MapGuide.getScale(extent, size, var scale = ol.source.ImageMapGuide.getScale(extent, size,
this.metersPerUnit_, this.displayDpi_); this.metersPerUnit_, this.displayDpi_);
var center = ol.extent.getCenter(extent); var center = ol.extent.getCenter(extent);
var baseParams = { var baseParams = {
'OPERATION': this.useOverlay_ ? 'GETDYNAMICMAPOVERLAYIMAGE' : 'GETMAPIMAGE', 'OPERATION': this.useOverlay_ ? 'GETDYNAMICMAPOVERLAYIMAGE' : 'GETMAPIMAGE',
'VERSION': '2.0.0', 'VERSION': '2.0.0',
'LOCALE': 'en', 'LOCALE': 'en',
'CLIENTAGENT': 'ol.source.MapGuide source', 'CLIENTAGENT': 'ol.source.ImageMapGuide source',
'CLIP': '1', 'CLIP': '1',
'SETDISPLAYDPI': this.displayDpi_, 'SETDISPLAYDPI': this.displayDpi_,
'SETDISPLAYWIDTH': Math.round(size[0]), 'SETDISPLAYWIDTH': Math.round(size[0]),