Skip to content

Commit

Permalink
Merge pull request #82 from iSpring/develop
Browse files Browse the repository at this point in the history
release version 0.5.1
  • Loading branch information
iSpring committed May 2, 2017
2 parents b1cb493 + 1f626ed commit 0f30b03
Show file tree
Hide file tree
Showing 160 changed files with 6,165 additions and 1,578 deletions.
4 changes: 4 additions & 0 deletions .babelrc
@@ -0,0 +1,4 @@
{
"presets": ["es2015", "react"],
"plugins": ["transform-class-properties", "add-module-exports"]
}
4 changes: 1 addition & 3 deletions .gitignore
@@ -1,4 +1,2 @@
/node_modules
/buildOutput
/src/**/*.js
index.html
/buildOutput
113 changes: 96 additions & 17 deletions README.md
@@ -1,16 +1,15 @@
<p align="center">
<div align="center">
<a target="_blank" href="https://ispring.github.io/WebGlobe/index.html">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/webglobe.png">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/webglobe.png">
</a>
<p align="center">A WebGL virtual globe and map engine</p>
</p>

</div>


## 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)
[![Release](https://img.shields.io/badge/release-0.5.1-blue.svg)](https://github.com/iSpring/WebGlobe/releases)
[![Gitter](https://badges.gitter.im/Join%20Chat.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)
Expand All @@ -25,27 +24,107 @@
[![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等
WebGlobe是基于HTML5原生WebGL实现的轻量级Google Earth三维地图引擎。

没有使用第三方框架,无需插件,所有支持WebGL的浏览器均可使用。效率高,内存占用少。会持续完善,目标是使其成为三维在线地图服务网站。
桌面版在线访问地址: https://ispring.github.io/WebGlobe/index.html

Demo: https://ispring.github.io/WebGlobe/index.html
移动版二维码访问(小米系统中的微信、小米默认浏览器在某些情况下存在已知bug):
<div align="center">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/qrcode.png">
</div>

**如果觉得不错,欢迎Star和Fork!**

## Setup dev environment
1. 项目有两个主要的分支:develop分支和master分支,develop是主分支,开发的代码都提交到该分支;master分支用于release,当develop分支中的代码比较稳定且有重要更新的时候,会将develop分支的代码merge到master分支,然后通过master分支进行发布新版本。
## Features
1. 没有使用第三方框架,无需插件,所有支持WebGL的浏览器均可使用。

2. 支持Google、高德、微软Bing、腾讯、360、OpenStreetMap等底图服务。

3. 支持影像图、行政图以及实施交通图。

4. 支持搜索服务,既可以按照POI类型搜索,也可以按照POI名称搜索。

5. 支持路线规划服务,支持自驾车、公交、步行三种出行方式,自驾车和公交出行均提供多种出行方案。

6. 支持移动浏览器并对移动浏览器做了优化,并针对移动端做了一个WebApp,能够实现常用的地图功能,具有实用性。

2. 项目采用TypeScript编写,使用Webpack进行编译打包,编译成JavaScript运行,推荐使用[Visual Studio Code](http://code.visualstudio.com/)作为编辑器。
## Getting Started
1. 在项目的根目录下执行`npm install`,安装所需模块。执行`npm start`即可进行打包编译,在`buildOutput`目录中,在浏览器中打开`index.html`可访问WebGlobe桌面版,打开`webapp.html`可访问WebGlobe移动版。

3. 在项目的根目录下执行npm install,安装所需模块
2. 项目有两个主要的分支:develop分支和master分支,develop是主分支,开发代码提交到该分支,master分支用于发布新版本

4. package.json中定义了npm scripts:
3. 项目的核心渲染引擎部分使用TypeScript进行开发,移动端WebApp界面采用Babel + React + react-router进行开发,使用Webpack进行构建,推荐使用最新的[Visual Studio Code](http://code.visualstudio.com/)作为编辑器。

4. package.json中定义了`npm scripts`
- npm run clean 用于清除编译打包的结果
- npm run build:dev 对代码进行编译打包,代码没有压缩混淆,用于开发环境
- npm run build:prod 对代码进行编译打包,代码进行了压缩混淆,用于生产环境
- npm start 用于执行build:dev

5. 开发过程中,在WebGlobe根目录下执行npm start即可进行打包编译

6. 有问题的话欢迎大家提issue或者到 https://gitter.im/iSpring/WebGlobe 进行讨论
5. 接入持续集成服务[Travis CI](https://travis-ci.org/iSpring/WebGlobe),保证代码质量。

6. 有问题的话欢迎大家提issue或者到[Gitter](https://gitter.im/iSpring/WebGlobe)中进行讨论。

## Screenshots
**1. WebGlobe移动端主界面**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/1.png">
</a>
</div>


**2. 附近搜索**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/2.png">
</a>
</div>


**3. 搜索结果列表展示**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/3.png">
</a>
</div>


**4. 搜索结果地图展示**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/4.png">
</a>
</div>


**5. 路线规划**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/5.png">
</a>
</div>


**6. 驾车出行路线**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/6.png">
</a>
</div>


**7. 公交出行路线**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/7.png">
</a>
</div>


**8. 步行出行路线**
<div align="left">
<a target="_blank" href="#">
<img src="https://github.com/iSpring/WebGlobe/blob/develop/images/8.png">
</a>
</div>
Binary file added images/1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/7.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/8.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/qrcode.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
26 changes: 0 additions & 26 deletions index.css

This file was deleted.

11 changes: 0 additions & 11 deletions index.ts

This file was deleted.

121 changes: 71 additions & 50 deletions package.json
@@ -1,51 +1,72 @@
{
"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"
}
}
"name": "webglobe",
"version": "0.5.1",
"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": {
"@types/es6-promise": "0.0.32",
"@types/react": "^15.0.21",
"@types/react-dom": "^0.14.23",
"babel-core": "^6.24.0",
"babel-loader": "^6.4.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-react": "^6.23.0",
"chalk": "^1.1.3",
"classnames": "^2.2.5",
"cross-env": "^3.1.3",
"css-loader": "^0.26.1",
"ejs-loader": "^0.3.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.10.1",
"html-loader": "^0.4.5",
"html-webpack-plugin": "^2.26.0",
"node-sass": "^4.5.0",
"rimraf": "^2.5.4",
"sass-loader": "^4.1.1",
"style-loader": "^0.13.1",
"ts-loader": "^1.3.3",
"typescript": "^2.0.3",
"webpack": "^1.14.0",
"webpack-md5-hash": "0.0.5"
},
"dependencies": {
"babel-polyfill": "^6.23.0",
"es6-promise": "^4.0.5",
"prop-types": "^15.5.8",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-router": "^3.0.3"
}
}
File renamed without changes
Binary file added src/core/images/fork-me-on-github.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
41 changes: 41 additions & 0 deletions src/core/index.scss
@@ -0,0 +1,41 @@
* {
margin: 0;
padding: 0;
}

html,
body {
width: 100%;
height: 100%;
}

body {
position: relative;
overflow: hidden;
cursor: default;
}

:global {
#canvasId {
cursor: default;
}
#fork-me {
position: absolute;
right: 0;
top: 0;
outline: none !important;
}
#fork-me img {
position: absolute;
top: 0;
right: 0;
left: auto;
bottom: auto;
}
#about-me {
position: absolute;
right: 0;
bottom: 0;
outline: none !important;
}
}
25 changes: 25 additions & 0 deletions src/core/index.ts
@@ -0,0 +1,25 @@
import Kernel from './world/Kernel';
import Globe, {GlobeOptions} from './world/Globe';
import './index.scss';
// declare function require(name: string): any;
// const template = require('./template.html');
// console.log(template);

(function () {
var options = new GlobeOptions();
options.satellite = true;
options.level = 3;
options.lonlat = 'auto';
var globe = Globe.getInstance(options);
globe.placeAt(document.body);
(<any>window).globe = globe;
(<any>window).kernel = Kernel;

function resize(){
globe.resize(window.innerWidth, window.innerHeight);
}

window.addEventListener("resize", resize, false);

resize();
})();

0 comments on commit 0f30b03

Please sign in to comment.