Named exports from ol/source/OSM
This commit is contained in:
+2
-2
@@ -7,7 +7,7 @@ import LineString from '../src/ol/geom/LineString.js';
|
|||||||
import Point from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||||
import OSM from '../src/ol/source/OSM.js';
|
import OSM, {ATTRIBUTION} from '../src/ol/source/OSM.js';
|
||||||
import VectorSource from '../src/ol/source/Vector.js';
|
import VectorSource from '../src/ol/source/Vector.js';
|
||||||
import CircleStyle from '../src/ol/style/Circle.js';
|
import CircleStyle from '../src/ol/style/Circle.js';
|
||||||
import Fill from '../src/ol/style/Fill.js';
|
import Fill from '../src/ol/style/Fill.js';
|
||||||
@@ -86,7 +86,7 @@ const map = new Map({
|
|||||||
source: new OSM({
|
source: new OSM({
|
||||||
attributions: [
|
attributions: [
|
||||||
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
|
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
|
||||||
OSM.ATTRIBUTION
|
ATTRIBUTION
|
||||||
],
|
],
|
||||||
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
|
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
|
||||||
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
|
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import Map from '../src/ol/Map.js';
|
|||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import OSM from '../src/ol/source/OSM.js';
|
import OSM, {ATTRIBUTION} from '../src/ol/source/OSM.js';
|
||||||
|
|
||||||
|
|
||||||
const openCycleMapLayer = new TileLayer({
|
const openCycleMapLayer = new TileLayer({
|
||||||
source: new OSM({
|
source: new OSM({
|
||||||
attributions: [
|
attributions: [
|
||||||
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
|
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
|
||||||
OSM.ATTRIBUTION
|
ATTRIBUTION
|
||||||
],
|
],
|
||||||
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
|
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
|
||||||
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
|
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
|
||||||
@@ -20,7 +20,7 @@ const openSeaMapLayer = new TileLayer({
|
|||||||
source: new OSM({
|
source: new OSM({
|
||||||
attributions: [
|
attributions: [
|
||||||
'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
|
'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
|
||||||
OSM.ATTRIBUTION
|
ATTRIBUTION
|
||||||
],
|
],
|
||||||
opaque: false,
|
opaque: false,
|
||||||
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
|
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
|
||||||
|
|||||||
+14
-12
@@ -4,6 +4,19 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import XYZ from '../source/XYZ.js';
|
import XYZ from '../source/XYZ.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attribution containing a link to the OpenStreetMap Copyright and License
|
||||||
|
* page.
|
||||||
|
* @const
|
||||||
|
* @type {string}
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
export const ATTRIBUTION = '© ' +
|
||||||
|
'<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
|
||||||
|
'contributors.';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Layer source for the OpenStreetMap tile server.
|
* Layer source for the OpenStreetMap tile server.
|
||||||
@@ -21,7 +34,7 @@ const OSM = function(opt_options) {
|
|||||||
if (options.attributions !== undefined) {
|
if (options.attributions !== undefined) {
|
||||||
attributions = options.attributions;
|
attributions = options.attributions;
|
||||||
} else {
|
} else {
|
||||||
attributions = [OSM.ATTRIBUTION];
|
attributions = [ATTRIBUTION];
|
||||||
}
|
}
|
||||||
|
|
||||||
const crossOrigin = options.crossOrigin !== undefined ?
|
const crossOrigin = options.crossOrigin !== undefined ?
|
||||||
@@ -46,15 +59,4 @@ const OSM = function(opt_options) {
|
|||||||
|
|
||||||
inherits(OSM, XYZ);
|
inherits(OSM, XYZ);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The attribution containing a link to the OpenStreetMap Copyright and License
|
|
||||||
* page.
|
|
||||||
* @const
|
|
||||||
* @type {string}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
OSM.ATTRIBUTION = '© ' +
|
|
||||||
'<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
|
|
||||||
'contributors.';
|
|
||||||
export default OSM;
|
export default OSM;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/source/Stamen
|
* @module ol/source/Stamen
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import OSM from '../source/OSM.js';
|
import {ATTRIBUTION as OSM_ATTRIBUTION} from '../source/OSM.js';
|
||||||
import XYZ from '../source/XYZ.js';
|
import XYZ from '../source/XYZ.js';
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ const ATTRIBUTIONS = [
|
|||||||
'Map tiles by <a href="https://stamen.com/">Stamen Design</a>, ' +
|
'Map tiles by <a href="https://stamen.com/">Stamen Design</a>, ' +
|
||||||
'under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY' +
|
'under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY' +
|
||||||
' 3.0</a>.',
|
' 3.0</a>.',
|
||||||
OSM.ATTRIBUTION
|
OSM_ATTRIBUTION
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user