OGC vector tile source
This commit is contained in:
22
examples/ogc-vector-tiles.js
Normal file
22
examples/ogc-vector-tiles.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import MVT from '../src/ol/format/MVT.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import OGCVectorTile from '../src/ol/source/OGCVectorTile.js';
|
||||
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
|
||||
import View from '../src/ol/View.js';
|
||||
|
||||
const map = new Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new VectorTileLayer({
|
||||
source: new OGCVectorTile({
|
||||
url: 'https://maps.ecere.com/ogcapi/collections/NaturalEarth:cultural:ne_10m_admin_0_countries/tiles/WebMercatorQuad',
|
||||
mediaType: 'application/vnd.mapbox-vector-tile',
|
||||
format: new MVT(),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 1,
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user