Imports cased like the filename
This commit is contained in:
58
src/ol/source/OSM.js
Normal file
58
src/ol/source/OSM.js
Normal file
@@ -0,0 +1,58 @@
|
||||
goog.provide('ol.source.OSM');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Layer source for the OpenStreetMap tile server.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.source.XYZ}
|
||||
* @param {olx.source.OSMOptions=} opt_options Open Street Map options.
|
||||
* @api
|
||||
*/
|
||||
ol.source.OSM = function(opt_options) {
|
||||
|
||||
var options = opt_options || {};
|
||||
|
||||
var attributions;
|
||||
if (options.attributions !== undefined) {
|
||||
attributions = options.attributions;
|
||||
} else {
|
||||
attributions = [ol.source.OSM.ATTRIBUTION];
|
||||
}
|
||||
|
||||
var crossOrigin = options.crossOrigin !== undefined ?
|
||||
options.crossOrigin : 'anonymous';
|
||||
|
||||
var url = options.url !== undefined ?
|
||||
options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||
|
||||
ol.source.XYZ.call(this, {
|
||||
attributions: attributions,
|
||||
cacheSize: options.cacheSize,
|
||||
crossOrigin: crossOrigin,
|
||||
opaque: options.opaque !== undefined ? options.opaque : true,
|
||||
maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
url: url,
|
||||
wrapX: options.wrapX
|
||||
});
|
||||
|
||||
};
|
||||
ol.inherits(ol.source.OSM, ol.source.XYZ);
|
||||
|
||||
|
||||
/**
|
||||
* The attribution containing a link to the OpenStreetMap Copyright and License
|
||||
* page.
|
||||
* @const
|
||||
* @type {string}
|
||||
* @api
|
||||
*/
|
||||
ol.source.OSM.ATTRIBUTION = '© ' +
|
||||
'<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
|
||||
'contributors.';
|
||||
Reference in New Issue
Block a user