- Notifications
You must be signed in to change notification settings - Fork511
A light and plugable JavaScript library for integrated 2D/3D maps.
maptalks/maptalks.js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
maptalks isupgrading to maptalks-gl, a webgl and webgpu driven 2D/3D map engine.
If you are looking for the old maptalks source codes, it has moved topackages/maptalks as a submodule.
maptalks-gl will be a pure WebGL driven map engine with performance and rich features in 3D. maptalks-gl is in active development now, and will be officially published in few months.
With consistent API upgrade, you can easily migrate fromlegacy maptalks to maptalks-gl. (TBD)
If you are interested in what is going on, please refer to the previousreleases notes of maptalks-gl.
- Vector Tile format support
- 3DTiles format support
- GLTF format support
- Magnificant performance enhancement by WebGL
- Rich 3D analysis functions
- Traffic simulation animations
npm i maptalks-gl#oryarn add maptalks-gl#orpnpm i maptalks-gl
import{Map,GroupGLLayer,VectorTileLayer,GLTFMarker,GLTFLayer,PolygonLayer}from'maptalks-gl';constmap=newMap('map',{center:[0,0],zoom:2});constvtLayer=newVectorTileLayer('vt',{urlTemplate:'http://tile.maptalks.com/test/planet-single/{z}/{x}/{y}.mvt'});constgroupLayer=newGroupGLLayer('group',[vtLayer]).addTo(map);constgltfLayer=newGLTFLayer('gltflayer');groupLayer.addLayer(gltfLayer);constpolygonLayer=newPolygonLayer('polygonlayer');groupLayer.addLayer(polygonLayer);//other layers
You can also reference umd-formatted packages via CDN, note that all exported variables under the gl system are automatically mounted in themaptalks
namespace.
<scripttype="text/javascript"src="https://unpkg.com/maptalks-gl/dist/maptalks-gl.js"></script><scripttype="text/javascript">constmap=newmaptalks.Map('map',{center:[0,0],zoom:2});constvtLayer=newmaptalks.VectorTileLayer('vt',{urlTemplate:'http://tile.maptalks.com/test/planet-single/{z}/{x}/{y}.mvt'});constgroupLayer=newmaptalks.GroupGLLayer('group',[vtLayer]).addTo(map);constgltfLayer=newmaptalks.GLTFLayer('gltflayer');groupLayer.addLayer(gltfLayer)constpolygonLayer=newmaptalks.PolygonLayer('polygonlayer');groupLayer.addLayer(polygonLayer);//other layers</script>
If you need to introduce optional draco, ktx2 and other gl format decoding plugins, just introduce the decoding plugins after introducing the summary package as before:
import{Map,Geo3DTilesLayer,GLTFLayer}from'maptalks-gl';import'@maptalks/transcoders.draco';import'@maptalks/transcoders.crn';import'@maptalks/transcoders.ktx2';
or with umd bundle:
<linkrel="stylesheet"href="https://unpkg.com/maptalks-gl/dist/maptalks-gl.css"><scripttype="text/javascript"src="https://unpkg.com/maptalks-gl/dist/maptalks-gl.js"></script><scripttype="text/javascript"src="https://unpkg.com/@maptalks/transcoders.draco/dist/transcoders.draco.js"></script><scripttype="text/javascript"src="https://unpkg.com/@maptalks/transcoders.crn/dist/transcoders.crn.js"></script><scripttype="text/javascript"src="https://unpkg.com/@maptalks/transcoders.ktx2/dist/transcoders.ktx2.js"></script>
gltf-loader
gltf format parsing library.reshader.gl
A regl-based implementation of the 3D rendering interface, including renderer, scene, mesh, material and other commonly used rendering base classes and predefined rendering materials, such as PBR.
maptalks
maptalks library source codes.
gl
WebGL base layer functionality, including GroupGLLayer, terrain, post-processing and various 3D mask implementations.layer-3dtiles
Implementation of the 3dtiles layer (Geo3DTilesLayer).layer-gltf
Implementation of gltf layer (GLTFLayer/GLTFMarker).layer-video
video layer (VideoLayer/VideoSurface) implementation
vt-plugin
Interface definition for the vector tile rendering plugin.vt
Vector tile layer (VectorTileLayer/GeoJSONVectorTileLayer) implementation.
analysis
Implementation of various 3D analysis functions.traffic
Implementation of traffic simulation.
transcoders.crn
crn format parsing librarytranscoders.draco
draco format parser librarytranscoders.ktx
ktx2 compressed texture format parser library.
The current minimum node environment is 18.16.1, if you don't meet the minimum node version requirement, you can usenvm /fnm to manage the node version.
Currently this project is usingpnpm@9.x.
pnpm i
pnpm build
If you need to debug the code base in watch mode, and the target of the compilation contains the source code, run the following command in the root folder of package you are debugging:
pnpm run dev
The project useskarma orelectron-mocha (vt vs. layer-3dtiles) as the test framework, and the test cases are written based on mocha syntax.
Runnpm test
under each project.
- If the project is based onelectron-mocha, run the
pnpm run tdd -- -g “spec keywords”
- If the project is based onkarma, you need to modify the test source code to specify the use cases to run via the only method in mocha, e.g..
it('spec name',()=>{});
Change to:
it.only('spec name',()=>{});
About
A light and plugable JavaScript library for integrated 2D/3D maps.
Topics
Resources
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.