OGC Vector Tiles - OpenLayers
文章推薦指數: 80 %
Because the specification has not yet been finalized, the OGCVectorTile source is not yet part of the stable API. main.js. import 'ol/ol.css'; import ...
×
ThisexampleusesOpenLayersv6.9.0.Thelatestisv.
×
ThisexampleusesfeaturesthatarenotpartofthestableAPIandsubjecttochangebetweenreleases.ConsulttheAPIdocumentation
toseewhatissupportedinthelatestrelease.
Edit
OGCVectorTiles
ogc3
vector66
×
RenderingvectortilesfromanOGCAPI–Tilesservice.
TheOGCAPI–Tilesspecificationdescribeshowaservicecanprovidevectortiles.Becausethespecificationhasnotyetbeenfinalized,theOGCVectorTilesourceisnotyetpartofthestableAPI.
main.js
import'ol/ol.css';
importMVTfrom'ol/format/MVT';
importMapfrom'ol/Map';
importOGCVectorTilefrom'ol/source/OGCVectorTile';
importVectorTileLayerfrom'ol/layer/VectorTile';
importViewfrom'ol/View';
constmap=newMap({
target:'map',
layers:[
newVectorTileLayer({
source:newOGCVectorTile({
url:'https://maps.ecere.com/ogcapi/collections/NaturalEarth:cultural:ne_10m_admin_0_countries/tiles/WebMercatorQuad',
format:newMVT(),
}),
}),
],
view:newView({
center:[0,0],
zoom:1,
}),
});
index.html
package.json { "name":"ogc-vector-tiles", "dependencies":{ "ol":"6.9.0" }, "devDependencies":{ "parcel":"^2.0.0-beta.1" }, "scripts":{ "start":"parcelindex.html", "build":"parcelbuild--public-url.index.html" } }
延伸文章資訊
- 1Specification | Vector tiles - Docs Mapbox
The Mapbox Vector Tile Specification explicitly provides information about file formats and exten...
- 2Mapbox Vector Tile specification - GitHub
Mapbox Vector Tile specification. Contribute to mapbox/vector-tile-spec development by creating a...
- 3OGC Vector Tiles - OpenLayers
Because the specification has not yet been finalized, the OGCVectorTile source is not yet part of...
- 4Vector Tile Specification - GitHub
A Vector Tile represents data based on a square extent within a projection. A Vector Tile SHOULD ...
- 5Vector tiles - Wikipedia
Mapbox has defined an open standard for vector map tiles called "vector-tile-spec" which uses Goo...