(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
[alias] | |
recent = "!git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' | head -n 10" | |
co = checkout | |
cob = checkout -b | |
coo = !git fetch && git checkout | |
br = branch | |
brd = branch -d | |
brD = branch -D | |
merged = branch --merged | |
st = status |
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
WGS-84 坐标系,是 GPS 系统所采用的坐标系。一切正常工作的 GPS 或 GPS 芯片所返回的坐标值都是这个坐标系下的数值。Google 地图采用的卫星图也是按照这个坐标系摆放的。
GCJ-02 坐标系,是我天朝政府搞出来的加密坐标系,也常常被称为“火星坐标系”。包括(但可能不限于)高德地图在内的国内地图服务商采用它来绘制地图。Apple、Google等国外公司在其道路地图中使用的也是高德的数据。BD-09 坐标系则是百度地图专用的坐标系。
在开发一些 LBS 应用时,如果不加处理,很容易出现几种形式的地图之间出现偏移的情况。因此在这几个坐标系之间进行转换非常重要。以下代码就是网络上泄露出的从 WGS-84 转 GCJ-02 的算法,以及 GCJ-02 与 BD-09 的互相转换算法。