Merge pull request #72 from twpayne/source-xyz-projection
Add projection option to ol.source.XYZ
This commit is contained in:
@@ -20,6 +20,7 @@ goog.require('ol.tilegrid.XYZ');
|
|||||||
* crossOrigin: (string|undefined),
|
* crossOrigin: (string|undefined),
|
||||||
* extent: (ol.Extent|undefined),
|
* extent: (ol.Extent|undefined),
|
||||||
* maxZoom: number,
|
* maxZoom: number,
|
||||||
|
* projection: (ol.Projection|undefined),
|
||||||
* tileUrlFunction: (ol.TileUrlFunctionType|undefined),
|
* tileUrlFunction: (ol.TileUrlFunctionType|undefined),
|
||||||
* url: (string|undefined),
|
* url: (string|undefined),
|
||||||
* urls: (Array.<string>|undefined)}}
|
* urls: (Array.<string>|undefined)}}
|
||||||
@@ -35,6 +36,9 @@ ol.source.XYZOptions;
|
|||||||
*/
|
*/
|
||||||
ol.source.XYZ = function(xyzOptions) {
|
ol.source.XYZ = function(xyzOptions) {
|
||||||
|
|
||||||
|
var projection = xyzOptions.projection ||
|
||||||
|
ol.Projection.getFromCode('EPSG:3857');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.TileUrlFunctionType}
|
* @type {ol.TileUrlFunctionType}
|
||||||
*/
|
*/
|
||||||
@@ -100,7 +104,7 @@ ol.source.XYZ = function(xyzOptions) {
|
|||||||
attributions: xyzOptions.attributions,
|
attributions: xyzOptions.attributions,
|
||||||
crossOrigin: xyzOptions.crossOrigin,
|
crossOrigin: xyzOptions.crossOrigin,
|
||||||
extent: xyzOptions.extent,
|
extent: xyzOptions.extent,
|
||||||
projection: ol.Projection.getFromCode('EPSG:3857'),
|
projection: projection,
|
||||||
tileGrid: tileGrid,
|
tileGrid: tileGrid,
|
||||||
tileUrlFunction: tileUrlFunction
|
tileUrlFunction: tileUrlFunction
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user