-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# 168 add 根据空间空间数据缩放范围,add 矢量图层叠加样式可传函数,fix logo bug,fix 图层对比,fix 图层清除方法
- Loading branch information
冯冬冬
committed
Jun 8, 2017
1 parent
eb3a180
commit 0b6cef6
Showing
15 changed files
with
570 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,9 @@ npm run build | |
### CDN引用 | ||
|
||
```bash | ||
https://unpkg.com/[email protected].2/dist/HMap.js | ||
https://unpkg.com/[email protected].2/dist/HMap.min.js | ||
https://unpkg.com/[email protected].2/dist/HMap.css | ||
https://unpkg.com/[email protected].4/dist/HMap.js | ||
https://unpkg.com/[email protected].4/dist/HMap.min.js | ||
https://unpkg.com/[email protected].4/dist/HMap.css | ||
``` | ||
|
||
### NPM包管理 | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="renderer" content="webkit"> | ||
<meta name="HandheldFriendly" content="True"> | ||
<meta name="MobileOptimized" content="320"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<title>测试空间数据解析</title> | ||
<link rel="stylesheet" href="../dist/HMap.css" type="text/css"> | ||
<style> | ||
html, body, #map { | ||
width: 100%; | ||
height: 100%; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="map"></div> | ||
<script src="../dist/HMap.js"></script> | ||
<script type="text/javascript"> | ||
var Maps = new HMap.Map(); | ||
Maps.initMap('map', { | ||
view: { | ||
center: [108.70284725808892, -54.69173110027741], | ||
projection: 'EPSG:3857', | ||
zoom: 5, // resolution | ||
}, | ||
baseLayers: [ | ||
{ | ||
layerName: 'openstreetmap', | ||
isDefault: true, | ||
layerType: 'OSM', | ||
opaque: true, //图层是否不透明 | ||
layerUrl: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png' | ||
} | ||
] | ||
}); | ||
|
||
function mapFirstClickHandler (event) { | ||
console.log(event.coordinate) | ||
} | ||
Maps.map.on('click', mapFirstClickHandler) | ||
Maps.map.un('click', mapFirstClickHandler) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Created by FDD on 2017/6/6. | ||
*/ | ||
class MathLine { | ||
constructor (radius) { | ||
if (radius && typeof radius === 'number') { | ||
this.radius = radius | ||
} else { | ||
this.radius = 6378137 | ||
} | ||
} | ||
|
||
/** | ||
* 计算地理坐标两点之间距离 | ||
* @param c1 | ||
* @param c2 | ||
* @returns {number} | ||
*/ | ||
haversineDistance (c1, c2) { | ||
let lat1 = this.toRadians(c1[1]) | ||
let lat2 = this.toRadians(c2[1]) | ||
let deltaLatBy2 = (lat2 - lat1) / 2 | ||
let deltaLonBy2 = this.toRadians(c2[0] - c1[0]) / 2 | ||
let a = Math.sin(deltaLatBy2) * Math.sin(deltaLatBy2) + | ||
Math.sin(deltaLonBy2) * Math.sin(deltaLonBy2) * | ||
Math.cos(lat1) * Math.cos(lat2) | ||
return 2 * this.radius * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) | ||
} | ||
|
||
toRadians (angleInDegrees) { | ||
return angleInDegrees * Math.PI / 180 | ||
} | ||
} | ||
|
||
export default MathLine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.