Merge pull request #10542 from mike-000/patch-6
Replace Bing layer with MapTiler in KML example
This commit is contained in:
+3
-3
@@ -4,10 +4,10 @@ title: KML
|
|||||||
shortdesc: Rendering KML with a vector source.
|
shortdesc: Rendering KML with a vector source.
|
||||||
docs: >
|
docs: >
|
||||||
This example uses the <code>ol/format/KML</code> to parse KML for rendering with a vector source.
|
This example uses the <code>ol/format/KML</code> to parse KML for rendering with a vector source.
|
||||||
tags: "KML"
|
tags: "KML, maptiler"
|
||||||
cloak:
|
cloak:
|
||||||
- key: As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5
|
- key: get_your_own_D6rA4zTHduk6KOKTXzGB
|
||||||
value: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
value: Get your own API key at https://www.maptiler.com/cloud/
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<div id="info"> </div>
|
<div id="info"> </div>
|
||||||
|
|||||||
+9
-4
@@ -2,13 +2,18 @@ import Map from '../src/ol/Map.js';
|
|||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import KML from '../src/ol/format/KML.js';
|
import KML from '../src/ol/format/KML.js';
|
||||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
import XYZ from '../src/ol/source/XYZ.js';
|
||||||
import VectorSource from '../src/ol/source/Vector.js';
|
import VectorSource from '../src/ol/source/Vector.js';
|
||||||
|
|
||||||
|
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 raster = new TileLayer({
|
const raster = 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