GithubHelp home page GithubHelp logo

dlsyaim / vin3gis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shuyunyu/vin3gis

0.0 0.0 0.0 2.76 MB

基于three.js开发的GIS框架

License: MIT License

JavaScript 2.92% TypeScript 95.71% HTML 0.05% GLSL 1.32%

vin3gis's Introduction

基于three.js开发的GIS框架。

在线demo: http://124.223.202.45/VGIS-Examples/vin3gis

Display a map

const mapViewer = new Vin3GIS.MapViewer({
    target: "map-div",
    imageryTileProivder: new Vin3GIS.AMapImageryTileProvider()
});

Display 3dtiles

const initCameraPosition = new THREE.Vector3(121.506, 31.238, 16500 * 0.7);
const initCameraOrientation = new THREE.Vector3(0, -90,0);
const homeViewPort = new Vin3GIS.ViewPort(
    Vin3GIS.Cartographic.fromDegrees(
        initCameraPosition.x,
        initCameraPosition.y,
        initCameraPosition.z
    ),
    Vin3GIS.Orientation.fromDegreeEulerAngles(initCameraOrientation)
);
const mapViewer = new Vin3GIS.MapViewer({
    target: "map-div",
    imageryTileProivder: new Vin3GIS.AMapImageryTileProvider({
        style: "aerial",
    }),
    homeViewPort: homeViewPort,
    camera: {
        near: 0.001
    }
});
const dracoLoader = new Vin3GIS.DRACOLoader()
dracoLoader.setDecoderPath("http://124.223.202.45/Vin3GIS/v0.0.1/libs/draco/");
const tileset = new Vin3GIS.Earth3DTileset({
    url: 'http://data.mars3d.cn/3dtiles/jzw-shanghai/tileset.json',
    dracoLoader: dracoLoader,
    coordinateOffsetType: Vin3GIS.enums.CoordinateOffsetType.GCJ02,
    customMaterial: (tileset, tile, content) => {
        return new THREE.MeshLambertMaterial({
            color: new THREE.Color('#aaa'),
            depthTest: true,
            transparent: false,
            depthWrite: true,
            side: THREE.DoubleSide
        });
    }
});
tileset.adjustHeight(71);
mapViewer.scene.primitives.add(tileset);

Install

  • NPM
npm install vin3gis --save
  • CDN
<!-- three.js -->
<script src="https://unpkg.com/[email protected]/build/three.min.js"></script>
<!-- Vin3GIS.min.js -->
<script src="https://unpkg.com/vin3gis/dist/Vin3GIS.min.js"></script>

vin3gis's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.