https://github.com/pana/easy-proj
Some easy use js proj function
https://github.com/pana/easy-proj
Last synced: 3 months ago
JSON representation
Some easy use js proj function
- Host: GitHub
- URL: https://github.com/pana/easy-proj
- Owner: Pana
- License: mit
- Created: 2013-09-23T06:37:51.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-28T10:04:00.000Z (almost 12 years ago)
- Last Synced: 2025-05-30T03:48:56.199Z (4 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
easy-proj
================
提供JS版本使用简单的Proj方法.## install
npm install easy-proj## example
```
var ep = require('easy-proj');
var lonLat = [119.23, 37.34], zoom = 14;
var pixel = ep.lnglat2pixel(lonLat[0], lonLat[1], zoom)
```### 文档
* `lnglat2pixel(lng, lat, z)` 经纬度转像素
* `pixel2lnglat(x, y, z)` 像素转经纬度
* `tile2pixel(x, y)` 切片转像素坐标, 返回切片四点像素坐标
* `pixel2title(x, y)` 像素转切片坐标
* `getTileXY(lng, lat, zoom)` 经纬度转切片编号
* `lnglat2web(lng, lat)` 经纬度转900913
* `web2lnglat(x, y)` 900913转经纬度
* `tile2web()` 切片坐标转900913坐标## 目标
* 提供全面的proj功能
* 使用简单
* 测试全面
* 文档全面, 清楚
* 注释清楚## 相关模块
* [proj4js](https://npmjs.org/package/proj4js)
* [proj4](https://npmjs.org/package/proj4)## [proj4](https://trac.osgeo.org/proj/)