Merge pull request #3225 from tschaub/attributions
Respect attributions passed to TileJSON source.
This commit is contained in:
+12
-1
@@ -4980,7 +4980,8 @@ olx.source.ServerVectorOptions.prototype.projection;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{crossOrigin: (null|string|undefined),
|
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||||
|
* crossOrigin: (null|string|undefined),
|
||||||
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
||||||
* url: string,
|
* url: string,
|
||||||
* wrapX: (boolean|undefined)}}
|
* wrapX: (boolean|undefined)}}
|
||||||
@@ -4989,6 +4990,16 @@ olx.source.ServerVectorOptions.prototype.projection;
|
|||||||
olx.source.TileJSONOptions;
|
olx.source.TileJSONOptions;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional attributions for the source. If provided, these will be used
|
||||||
|
* instead of any attribution data advertised by the server. If not provided,
|
||||||
|
* any attributions advertised by the server will be used.
|
||||||
|
* @type {Array.<ol.Attribution>|undefined}
|
||||||
|
* @api stable
|
||||||
|
*/
|
||||||
|
olx.source.TileJSONOptions.prototype.attributions;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ goog.require('ol.tilegrid.XYZ');
|
|||||||
ol.source.TileJSON = function(options) {
|
ol.source.TileJSON = function(options) {
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
|
attributions: options.attributions,
|
||||||
crossOrigin: options.crossOrigin,
|
crossOrigin: options.crossOrigin,
|
||||||
projection: ol.proj.get('EPSG:3857'),
|
projection: ol.proj.get('EPSG:3857'),
|
||||||
state: ol.source.State.LOADING,
|
state: ol.source.State.LOADING,
|
||||||
@@ -87,7 +88,8 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
|
|||||||
}),
|
}),
|
||||||
ol.TileUrlFunction.createFromTemplates(tileJSON.tiles));
|
ol.TileUrlFunction.createFromTemplates(tileJSON.tiles));
|
||||||
|
|
||||||
if (goog.isDef(tileJSON.attribution)) {
|
if (goog.isDef(tileJSON.attribution) &&
|
||||||
|
goog.isNull(this.getAttributions())) {
|
||||||
var attributionExtent = goog.isDef(extent) ?
|
var attributionExtent = goog.isDef(extent) ?
|
||||||
extent : epsg4326Projection.getExtent();
|
extent : epsg4326Projection.getExtent();
|
||||||
/** @type {Object.<string, Array.<ol.TileRange>>} */
|
/** @type {Object.<string, Array.<ol.TileRange>>} */
|
||||||
|
|||||||
Reference in New Issue
Block a user