8000 GitHub - BranZhang/deck.gl: WebGL2 powered visualization framework
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
forked from visgl/deck.gl

WebGL2 powered visualization framework

License

Notifications You must be signed in to change notification settings

BranZhang/deck.gl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deck.gl with EPSG:4326

I used to work on making MapboxJS and deck.gl support EPSG:4326 projection, so I share my code in this repo.

About how to make mapbox supports EPSG:4326 projection, you can refer to this repo,

https://github.com/cgcs2000/mapbox-gl-js

This file ./examples/get-started/pure-js/mapbox/mapbox-gl.js, is compiled from this repo.

By the way, cgcs2000 is similar to wgs84, you can treat them as same thing when talking about map projection.

Enter ./examples/get-started/pure-js/mapbox/ folder, and run webpack server, you will get a map like this picture.

screenshot

Currently, you should only use this deck.gl with mapbox, and deck.gl should be added to mapbox as a layer.

Because deck.gl will not work properly with mouse drag and wheel zoom.

If you want to use this code in your production, you still have some other work to do.

some detail

I notice the calculation about map projection is processed by math.gl, so I copied all math.gl into this repo and made some change.

For example:

// Unproject world point [x,y] on map onto {lat, lon} on sphere
export function worldToLngLat([x, y], srs) {
  const lambda2 = (x / TILE_SIZE) * (2 * PI) - PI;
  let phi2;
  if (srs === SRS.EPSG3857) {
    phi2 = 2 * (Math.atan(Math.exp((y / TILE_SIZE) * (2 * PI) - PI)) - PI_4);
  } else {
    phi2 = PI / 2 - 2 * PI * (1 - y / TILE_SIZE);
  }
  return [lambda2 * RADIANS_TO_DEGREES, phi2 * RADIANS_TO_DEGREES];
}

About

WebGL2 powered visualization framework

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 85.1%
  • TypeScript 6.1%
  • Python 4.7%
  • Jupyter Notebook 1.5%
  • CSS 1.3%
  • HTML 0.9%
  • Other 0.4%
0