diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f2878e1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: node_js + +before_install: + - nvm install 6 + +install: + - npm install + +script: + - npm run test \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 7d0e9bf..58f1d16 --- a/README.md +++ b/README.md @@ -8,6 +8,23 @@ ## WebGlobe +[![Build Status](https://travis-ci.org/iSpring/WebGlobe.svg?branch=develop)](https://travis-ci.org/iSpring/WebGlobe) +[![Release](https://img.shields.io/badge/release-0.4.4-blue.svg)](https://github.com/iSpring/WebGlobe/releases) +[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/iSpring/WebGlobe) + +[![Chrome 8+](https://img.shields.io/badge/Chrome-8+-1DA362.svg)](http://caniuse.com/#search=WebGL) +[![Firefox 4+](https://img.shields.io/badge/Firefox-4+-E77827.svg)](http://caniuse.com/#search=WebGL) +[![IE11](https://img.shields.io/badge/IE-11+-00BCF2.svg)](http://caniuse.com/#search=WebGL) +[![Edge12+](https://img.shields.io/badge/Edge-12+-2F78BD.svg)](http://caniuse.com/#search=WebGL) +[![Safari 5.1+](https://img.shields.io/badge/Safari-5.1+-07C0F2.svg)](http://caniuse.com/#search=WebGL) +[![Opera 12.1+](https://img.shields.io/badge/Opera-12.1+-E23232.svg)](http://caniuse.com/#search=WebGL) + +[![Chrome for Android 25+](https://img.shields.io/badge/Chrome%20for%20Android-25+-1DA362.svg)](http://caniuse.com/#search=WebGL) +[![Firefox Mobile 4+](https://img.shields.io/badge/Firefox%20Mobile-4+-E77827.svg)](http://caniuse.com/#search=WebGL) +[![Safari Mobile 8.1+](https://img.shields.io/badge/Safari%20Mobile-8.1%2B-07C0F2.svg)](http://caniuse.com/#search=WebGL) +[![Opera Mobile 12+](https://img.shields.io/badge/Opera%20Mobile-12+-E23232.svg)](http://caniuse.com/#search=WebGL) + + WebGlobe是基于HTML5原生WebGL实现的轻量级Google Earth三维地图引擎,支持Google地图、微软Bing地图、OpenStreetMap等。 没有使用第三方框架,无需插件,所有支持WebGL的浏览器均可使用。效率高,内存占用少。会持续完善,目标是使其成为三维在线地图服务网站。 @@ -24,9 +41,11 @@ Demo: https://ispring.github.io/WebGlobe/index.html 3. 在项目的根目录下执行npm install,安装所需模块。 4. package.json中定义了npm scripts: - - npm run clear 用于清除编译打包的结果 + - npm run clean 用于清除编译打包的结果 - npm run build:dev 对代码进行编译打包,代码没有压缩混淆,用于开发环境 - npm run build:prod 对代码进行编译打包,代码进行了压缩混淆,用于生产环境 - npm start 用于执行build:dev - 5. 有问题的话欢迎大家提issue或者到 https://gitter.im/iSpring/Lobby 进行讨论,这样更方便沟通。 + 5. 开发过程中,在WebGlobe根目录下执行npm start即可进行打包编译 + + 6. 有问题的话欢迎大家提issue或者到 https://gitter.im/iSpring/WebGlobe 进行讨论 diff --git a/images/WebGL.png b/images/WebGL.png old mode 100644 new mode 100755 diff --git a/images/iSpring.png b/images/iSpring.png old mode 100644 new mode 100755 diff --git a/images/logo.png b/images/logo.png old mode 100644 new mode 100755 diff --git a/index.css b/index.css old mode 100644 new mode 100755 diff --git a/index.ts b/index.ts old mode 100644 new mode 100755 index a329ad7..526f6b1 --- a/index.ts +++ b/index.ts @@ -1,6 +1,8 @@ import Kernel = require("./src/world/Kernel"); import Globe = require("./src/world/Globe"); +import "./index.css"; + (function () { var canvas = document.getElementById("canvasId"); var globe = new Globe(canvas); diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 522bd53..dfaeb8d --- a/package.json +++ b/package.json @@ -1,44 +1,51 @@ { - "name": "webglobe", - "version": "0.4.4", - "description": "A WebGL virtual globe and map engine.", - "main": "require.js", - "scripts": { - "clear": "rimraf buildOutput", - "prebuild:dev": "npm run clear", - "build:dev": "cross-env NODE_ENV=development webpack --progress --colors", - "prebuild:prod": "npm run clear", - "build:prod": "cross-env NODE_ENV=production webpack --progress --colors", - "start": "npm run build:dev" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/iSpring/WebGlobe.git" - }, - "keywords": [ - "WebGL", - "Map", - "Globe", - "Earth", - "3D", - "HTML5" - ], - "author": "iSpring", - "license": "ISC", - "bugs": { - "url": "https://github.com/iSpring/WebGlobe/issues" - }, - "homepage": "https://github.com/iSpring/WebGlobe#readme", - "devDependencies": { - "cross-env": "^3.1.3", - "ejs-loader": "^0.3.0", - "html-webpack-plugin": "^2.26.0", - "rimraf": "^2.5.4", - "ts-loader": "^1.3.3", - "typescript": "^2.0.3", - "webpack": "^1.14.0" - }, - "dependencies": { - "es6-promise": "^4.0.5" - } -} \ No newline at end of file + "name": "webglobe", + "version": "0.4.4", + "description": "A WebGL virtual globe and map engine.", + "main": "require.js", + "scripts": { + "clean": "rimraf buildOutput && rimraf index.html", + "prebuild:dev": "npm run clean", + "build:dev": "cross-env NODE_ENV=development webpack --progress --colors", + "prebuild:prod": "npm run clean", + "build:prod": "cross-env NODE_ENV=production webpack --progress --colors", + "start": "npm run build:dev", + "test": "cross-env NODE_ENV=development webpack --progress --colors --ci" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/iSpring/WebGlobe.git" + }, + "keywords": [ + "WebGL", + "Map", + "Globe", + "Earth", + "3D", + "HTML5" + ], + "author": "iSpring", + "engines": { + "node": ">=6.0.0" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/iSpring/WebGlobe/issues" + }, + "homepage": "https://github.com/iSpring/WebGlobe#readme", + "devDependencies": { + "chalk": "^1.1.3", + "cross-env": "^3.1.3", + "css-loader": "^0.26.1", + "ejs-loader": "^0.3.0", + "html-webpack-plugin": "^2.26.0", + "rimraf": "^2.5.4", + "style-loader": "^0.13.1", + "ts-loader": "^1.3.3", + "typescript": "^2.0.3", + "webpack": "^1.14.0" + }, + "dependencies": { + "es6-promise": "^4.0.5" + } +} diff --git a/src/world/Camera.ts b/src/world/Camera.ts old mode 100644 new mode 100755 diff --git a/src/world/Definitions.d.ts b/src/world/Definitions.d.ts old mode 100644 new mode 100755 diff --git a/src/world/EventHandler.ts b/src/world/EventHandler.ts old mode 100644 new mode 100755 diff --git a/src/world/Extent.ts b/src/world/Extent.ts old mode 100644 new mode 100755 diff --git a/src/world/Globe.ts b/src/world/Globe.ts old mode 100644 new mode 100755 diff --git a/src/world/GraphicGroup.ts b/src/world/GraphicGroup.ts old mode 100644 new mode 100755 diff --git a/src/world/Image.ts b/src/world/Image.ts old mode 100644 new mode 100755 diff --git a/src/world/Kernel.ts b/src/world/Kernel.ts old mode 100644 new mode 100755 diff --git a/src/world/LocationService.ts b/src/world/LocationService.ts old mode 100644 new mode 100755 diff --git a/src/world/Object3D.ts b/src/world/Object3D.ts old mode 100644 new mode 100755 diff --git a/src/world/Program.ts b/src/world/Program.ts old mode 100644 new mode 100755 diff --git a/src/world/Renderer.ts b/src/world/Renderer.ts old mode 100644 new mode 100755 diff --git a/src/world/Scene.ts b/src/world/Scene.ts old mode 100644 new mode 100755 diff --git a/src/world/TileGrid.ts b/src/world/TileGrid.ts old mode 100644 new mode 100755 diff --git a/src/world/Utils.ts b/src/world/Utils.ts old mode 100644 new mode 100755 diff --git a/src/world/VertexBufferObject.ts b/src/world/VertexBufferObject.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/Atmosphere.ts b/src/world/geometries/Atmosphere.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/Box.ts b/src/world/geometries/Box.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/Geometry.ts b/src/world/geometries/Geometry.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/Marker.ts b/src/world/geometries/Marker.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/Mesh.ts b/src/world/geometries/Mesh.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/MeshVertice.ts b/src/world/geometries/MeshVertice.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/TileGeometry.ts b/src/world/geometries/TileGeometry.ts old mode 100644 new mode 100755 diff --git a/src/world/geometries/Triangle.ts b/src/world/geometries/Triangle.ts old mode 100644 new mode 100755 diff --git a/src/world/graphics/Atmosphere.ts b/src/world/graphics/Atmosphere.ts old mode 100644 new mode 100755 diff --git a/src/world/graphics/Graphic.ts b/src/world/graphics/Graphic.ts old mode 100644 new mode 100755 diff --git a/src/world/graphics/Locator.ts b/src/world/graphics/Locator.ts old mode 100644 new mode 100755 diff --git a/src/world/graphics/MeshGraphic.ts b/src/world/graphics/MeshGraphic.ts old mode 100644 new mode 100755 diff --git a/src/world/graphics/Tile.ts b/src/world/graphics/Tile.ts old mode 100644 new mode 100755 diff --git a/src/world/images/atmosphere.png b/src/world/images/atmosphere.png old mode 100644 new mode 100755 diff --git a/src/world/images/location.png b/src/world/images/location.png old mode 100644 new mode 100755 diff --git a/src/world/images/pin.png b/src/world/images/pin.png old mode 100644 new mode 100755 diff --git a/src/world/images/poi.png b/src/world/images/poi.png old mode 100644 new mode 100755 diff --git a/src/world/layers/ArcGISTiledLayer.ts b/src/world/layers/ArcGISTiledLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/Autonavi.ts b/src/world/layers/Autonavi.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/BingTiledLayer.ts b/src/world/layers/BingTiledLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/BlendTiledLayer.ts b/src/world/layers/BlendTiledLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/Google.ts b/src/world/layers/Google.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/LabelLayer.ts b/src/world/layers/LabelLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/NokiaTiledLayer.ts b/src/world/layers/NokiaTiledLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/OsmTiledLayer.ts b/src/world/layers/OsmTiledLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/PoiLayer.ts b/src/world/layers/PoiLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/Qihu.ts b/src/world/layers/Qihu.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/Soso.ts b/src/world/layers/Soso.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/SubTiledLayer.ts b/src/world/layers/SubTiledLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/TiledLayer.ts b/src/world/layers/TiledLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/layers/TrafficLayer.ts b/src/world/layers/TrafficLayer.ts old mode 100644 new mode 100755 diff --git a/src/world/materials/Material.ts b/src/world/materials/Material.ts old mode 100644 new mode 100755 diff --git a/src/world/materials/MeshColorMaterial.ts b/src/world/materials/MeshColorMaterial.ts old mode 100644 new mode 100755 diff --git a/src/world/materials/MeshTextureMaterial.ts b/src/world/materials/MeshTextureMaterial.ts old mode 100644 new mode 100755 diff --git a/src/world/materials/PoiMaterial.ts b/src/world/materials/PoiMaterial.ts old mode 100644 new mode 100755 diff --git a/src/world/materials/TileMaterial.ts b/src/world/materials/TileMaterial.ts old mode 100644 new mode 100755 diff --git a/src/world/math/Line.ts b/src/world/math/Line.ts old mode 100644 new mode 100755 diff --git a/src/world/math/Matrix.ts b/src/world/math/Matrix.ts old mode 100644 new mode 100755 diff --git a/src/world/math/Plan.ts b/src/world/math/Plan.ts old mode 100644 new mode 100755 diff --git a/src/world/math/Ray.ts b/src/world/math/Ray.ts old mode 100644 new mode 100755 diff --git a/src/world/math/Utils.ts b/src/world/math/Utils.ts old mode 100644 new mode 100755 diff --git a/src/world/math/Vector.ts b/src/world/math/Vector.ts old mode 100644 new mode 100755 diff --git a/src/world/math/Vertice.ts b/src/world/math/Vertice.ts old mode 100644 new mode 100755 diff --git a/template.html b/template.html old mode 100644 new mode 100755 index 3bbf481..836977f --- a/template.html +++ b/template.html @@ -13,7 +13,6 @@ - diff --git a/tsconfig.json b/tsconfig.json old mode 100644 new mode 100755 diff --git a/versions.txt b/versions.txt old mode 100644 new mode 100755 diff --git a/webglobe.png b/webglobe.png old mode 100644 new mode 100755 diff --git a/webpack.config.js b/webpack.config.js old mode 100644 new mode 100755 index c9cbd4a..4d4b742 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,10 @@ var path = require('path'); +var chalk = require('chalk'); var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); +//https://github.com/webpack/webpack/issues/708 + module.exports = { entry: path.resolve(__dirname, "./index.ts"), output: { @@ -13,7 +16,8 @@ module.exports = { }, module: { loaders: [ - { test: /\.tsx?$/, loader: "ts-loader" } + { test: /\.tsx?$/, loader: "ts-loader" }, + { test: /\.css$/, loader: "style!css"} ] }, plugins: [ @@ -26,6 +30,28 @@ module.exports = { ] }; +if(process.argv.indexOf("--ci") >= 0){ + module.exports.plugins.push( + function(){ + this.plugin("done", function(stats){ + var errors = stats.compilation.errors; + if(errors && errors.length > 0){ + console.log(""); + console.log(chalk.red("----------------------------------------------------------------")); + errors.forEach(function(err){ + var msg = chalk.red(`ERROR in ${err.module.userRequest},`); + msg += chalk.blue(`(${err.location.line},${err.location.character}),`); + msg += chalk.red(err.rawMessage); + console.log(msg); + }); + console.log(chalk.red("----------------------------------------------------------------")); + process.exit(1); + } + }); + } + ); +} + if(process.env.NODE_ENV === 'production'){ module.exports.plugins.push(new webpack.optimize.UglifyJsPlugin()); } \ No newline at end of file