OGC Vector Tiles - OpenLayers

文章推薦指數: 80 %
投票人數:10人

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 OGCVectorTiles

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" } }



請為這篇文章評分?