mapbox/vector-tile-js - GitHub
文章推薦指數: 80 %
Parses vector tiles with JavaScript. Contribute to mapbox/vector-tile-js development by creating an account on GitHub.
Skiptocontent
{{message}}
mapbox
/
vector-tile-js
Public
Notifications
Star
268
Fork
69
ParsesvectortileswithJavaScript
BSD-3-ClauseLicense
268
stars
69
forks
Star
Notifications
Code
Issues
10
Pullrequests
7
Projects
0
Wiki
Security
Insights
More
Code
Issues
Pullrequests
Projects
Wiki
Security
Insights
master
Branches
Tags
Couldnotloadbranches
Nothingtoshow
Loading
{{refName}}
default
Couldnotloadtags
Nothingtoshow
{{refName}}
default
Loading
8
branches
14
tags
Code
Loading
Latestcommit
Gitstats
93
commits
Files
Permalink
Failedtoloadlatestcommitinformation.
Type
Name
Latestcommitmessage
Committime
lib
proto
test
.eslintrc
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.txt
README.md
fixtures.js
index.js
package.json
Viewcode
vector-tile
Example
Depends
Install
APIReference
VectorTile
Constructor
Properties
VectorTileLayer
Properties
Methods
VectorTileFeature
Properties
Methods
README.md
vector-tile
ThislibraryreadsMapboxVectorTilesandallowsaccesstothelayersandfeatures.
Example
varVectorTile=require('@mapbox/vector-tile').VectorTile;
varProtobuf=require('pbf');
vartile=newVectorTile(newProtobuf(data));
//Containsamapofalllayers
tile.layers;
varlanduse=tile.layers.landuse;
//Amountoffeaturesinthislayer
landuse.length;
//Returnsthefirstfeature
landuse.feature(0);
Vectortilescontainedinserialtiles-spec
aregzip-encoded,soacompleteexampleofparsingthemwiththenative
zlibmodulewouldbe:
varVectorTile=require('vector-tile').VectorTile;
varProtobuf=require('pbf');
varzlib=require('zlib');
zlib.gunzip(data,function(err,buffer){
vartile=newVectorTile(newProtobuf(buffer));
});
Depends
Node.jsv0.10.xorv0.8.x
Install
Toinstall:
npminstall@mapbox/vector-tile
APIReference
VectorTile
Anobjectthatparsesvectortiledataandmakesitreadable.
Constructor
newVectorTile(protobuf[,end])—
parsesthevectortiledatacontainedinthegivenProtobufobject,
savingresultinglayersinthecreatedobjectasalayersproperty.Optionallyacceptsendindex.
Properties
layers(Object)—anobjectcontainingparsedlayersintheformof{
延伸文章資訊
- 1HERE Vector Tile Examples
Examples of the HERE Vector Tile API with various 3rd party web map renderers. ... From left to r...
- 2Reference | Vector tiles - Docs Mapbox
- 3@mapbox/vector-tile - npm
@mapbox/vector-tile. 1.3.1 • Public • Published 4 years ago. Readme · Explore BETA · 1 Dependency...
- 4mapbox/vector-tile-js - GitHub
Parses vector tiles with JavaScript. Contribute to mapbox/vector-tile-js development by creating ...
- 5Unlimited private tilesets available for all users - Mapbox blog