OGC vector tile source
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: OGC Vector Tiles
|
||||
shortdesc: Rendering vector tiles from an OGC API – Tiles service.
|
||||
docs: >
|
||||
The OGC API – Tiles specification describes how a service can provide vector tiles.
|
||||
tags: "ogc, vector"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
@@ -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