Replace Bing layer with MapTiler
This commit is contained in:
@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
|
|||||||
import {GPX, GeoJSON, IGC, KML, TopoJSON} from '../src/ol/format.js';
|
import {GPX, GeoJSON, IGC, KML, TopoJSON} from '../src/ol/format.js';
|
||||||
import {defaults as defaultInteractions, DragAndDrop} from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions, DragAndDrop} from '../src/ol/interaction.js';
|
||||||
import {VectorImage as VectorImageLayer, Tile as TileLayer} from '../src/ol/layer.js';
|
import {VectorImage as VectorImageLayer, Tile as TileLayer} from '../src/ol/layer.js';
|
||||||
import {BingMaps, Vector as VectorSource} from '../src/ol/source.js';
|
import {XYZ, Vector as VectorSource} from '../src/ol/source.js';
|
||||||
|
|
||||||
const dragAndDropInteraction = new DragAndDrop({
|
const dragAndDropInteraction = new DragAndDrop({
|
||||||
formatConstructors: [
|
formatConstructors: [
|
||||||
@@ -15,13 +15,18 @@ const dragAndDropInteraction = new DragAndDrop({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const key = 'get_your_own_D6rA4zTHduk6KOKTXzGB';
|
||||||
|
const attributions = '<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> ' +
|
||||||
|
'<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>';
|
||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
interactions: defaultInteractions().extend([dragAndDropInteraction]),
|
interactions: defaultInteractions().extend([dragAndDropInteraction]),
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new BingMaps({
|
source: new XYZ({
|
||||||
imagerySet: 'Aerial',
|
attributions: attributions,
|
||||||
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
|
url: 'https://api.maptiler.com/tiles/satellite/{z}/{x}/{y}.jpg?key=' + key,
|
||||||
|
maxZoom: 20
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user