Skip to content

Commit 07b47dc

Browse files
committed
fix(pkg): 修复命名错误
1 parent e04cd5b commit 07b47dc

File tree

12 files changed

+58
-411
lines changed

12 files changed

+58
-411
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish Package to npmjs
2+
3+
permissions:
4+
contents: read
5+
packages: write
6+
7+
on:
8+
push:
9+
branches: [main]
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: "20"
19+
- run: npm i
20+
- run: npm run build
21+
- uses: JS-DevTools/npm-publish@v2
22+
with:
23+
token: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
## tile-lnglat-transform
1+
## tile-lnglat-transform-es6
22
>提供了高德、百度、谷歌、腾讯和必应地图的经纬度坐标与瓦片坐标的相互转换
33
44
## 特点
55
* 实现了国内常用地图的经纬度坐标与瓦片坐标的相互转换
6-
* 使用 UMD,ESM,CJS 模块打包,可以在 node 和 browser 中直接使用
6+
* 使用 UMD,ESM 模块打包,可以在 node 和 browser 中直接使用
7+
* 支持TypeScript
78

89

910
## 注意
1011
* 请使用支持ES6及以上的浏览器版本
1112

1213
## 转换原理
13-
各地图的瓦片坐标系定义、转换原理和转换公式可以参见博文:[国内主要地图瓦片坐标系定义及计算原理][国内主要地图瓦片坐标系定义及计算原理]
14+
各地图的瓦片坐标系定义、转换原理和转换公式可以参见博文:[国内主要地图瓦片坐标系定义及计算原理](http://cntchen.github.io/2016/05/09/%E5%9B%BD%E5%86%85%E4%B8%BB%E8%A6%81%E5%9C%B0%E5%9B%BE%E7%93%A6%E7%89%87%E5%9D%90%E6%A0%87%E7%B3%BB%E5%AE%9A%E4%B9%89%E5%8F%8A%E8%AE%A1%E7%AE%97%E5%8E%9F%E7%90%86/)
1415

1516
## 使用方法
1617
*以 node 中使用为例。*
@@ -23,22 +24,21 @@ $ npm i tile-lnglat-transform-es6
2324
* 使用
2425
```ts
2526
// 引入模块
26-
// var TileLnglatTransform = require('tile-lnglat-transform-es6');
2727
import TileLnglatTransform from 'tile-lnglat-transform-es6'
2828
// 根据地图平台使用转换类
29-
var TileLnglatTransformGaode = TileLnglatTransform.TileLnglatTransformGaode;
30-
var TileLnglatTransformGoogle = TileLnglatTransform.TileLnglatTransformGoogle;
31-
var TileLnglatTransformBaidu = TileLnglatTransform.TileLnglatTransformBaidu;
29+
const TileLnglatTransformGaode = TileLnglatTransform.TileLnglatTransformGaode;
30+
const TileLnglatTransformGoogle = TileLnglatTransform.TileLnglatTransformGoogle;
31+
const TileLnglatTransformBaidu = TileLnglatTransform.TileLnglatTransformBaidu;
3232
```
3333

3434
## 文档
3535

3636
### 模块
3737
每个地图平台提供一个转换对象。如:
3838
```ts
39-
var TileLnglatTransformGaode = TileLnglatTransform.TileLnglatTransformGaode;
40-
var TileLnglatTransformGoogle = TileLnglatTransform.TileLnglatTransformGoogle;
41-
var TileLnglatTransformBaidu = TileLnglatTransform.TileLnglatTransformBaidu;
39+
const TileLnglatTransformGaode = TileLnglatTransform.TileLnglatTransformGaode;
40+
const TileLnglatTransformGoogle = TileLnglatTransform.TileLnglatTransformGoogle;
41+
const TileLnglatTransformBaidu = TileLnglatTransform.TileLnglatTransformBaidu;
4242
```
4343

4444
### 通用转换函数
@@ -82,7 +82,7 @@ var TileLnglatTransformBaidu = TileLnglatTransform.TileLnglatTransformBaidu;
8282
@output:`{lng, lat}`
8383

8484
#### Bing 地图
85-
Bing 地图使用 [Slippy][Slippy] 方式,经纬度坐标和瓦片坐标转换与 Google 地图相同。
85+
Bing 地图使用 [Slippy](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) 方式,经纬度坐标和瓦片坐标转换与 Google 地图相同。
8686
不同的是 Bing 地图使用 quadkey(四叉树编码)来标识瓦片。
8787

8888
* 瓦片坐标转四叉树编码`lnglatToQuadkey`
@@ -122,7 +122,7 @@ $ node test/test_node.js
122122
### 测试数据
123123
使用的瓦片等级为15级,测试经纬度为:
124124
```
125-
var lnglat = {lng: 113.3964152, lat: 23.0581857};
125+
const lnglat = {lng: 113.3964152, lat: 23.0581857};
126126
```
127127

128128
### 经纬度标注结果
@@ -141,10 +141,10 @@ var lnglat = {lng: 113.3964152, lat: 23.0581857};
141141
### 验证图例
142142
| 类型 | 地图上经纬度标注截图 | 转换后瓦片截图(图中红点标记) |
143143
| :-: | :-: | :-: |
144-
| 高德 | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/113.3964152_23.0581857_%E9%AB%98%E5%BE%B7%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/gaode_map_labeled.png?raw=true" height="256"/> |
145-
| 百度 | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/113.3964152_23.0581857_%E7%99%BE%E5%BA%A6%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/baidu_map_labeled.png?raw=true" height="256"/> |
146-
| google | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/113.3964152_23.0581857_Google%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/google_map_labeled.png?raw=true" height="256"/> |
147-
| 腾讯 | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/113.3964152_23.0581857_%E8%85%BE%E8%AE%AF%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/CntChen/tile-lnglat-transform/blob/master/test/test_result/tencent_map_labeled.png?raw=true" height="256"/> |
144+
| 高德 | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/113.3964152_23.0581857_%E9%AB%98%E5%BE%B7%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/gaode_map_labeled.png?raw=true" height="256"/> |
145+
| 百度 | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/113.3964152_23.0581857_%E7%99%BE%E5%BA%A6%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/baidu_map_labeled.png?raw=true" height="256"/> |
146+
| google | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/113.3964152_23.0581857_Google%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/google_map_labeled.png?raw=true" height="256"/> |
147+
| 腾讯 | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/113.3964152_23.0581857_%E8%85%BE%E8%AE%AF%E4%BD%8D%E7%BD%AE.png?raw=true" height="256"/> | <img src="https://github.com/aliothor/tile-lnglat-transform-es6/blob/main/test/test_result/tencent_map_labeled.png?raw=true" height="256"/> |
148148

149149
### 各地图查询接口示例
150150
* 高德地图
@@ -189,20 +189,12 @@ var lnglat = {lng: 113.3964152, lat: 23.0581857};
189189
5. Pull request
190190
191191
## 参考资料
192-
国内主要地图瓦片坐标系定义及计算原理
193-
>http://cntchen.github.io/2016/05/09/国内主要地图瓦片坐标系定义及计算原理/
194192
195-
[国内主要地图瓦片坐标系定义及计算原理]: http://cntchen.github.io/2016/05/09/国内主要地图瓦片坐标系定义及计算原理/
193+
> [国内主要地图瓦片坐标系定义及计算原理](http://cntchen.github.io/2016/05/09/%E5%9B%BD%E5%86%85%E4%B8%BB%E8%A6%81%E5%9C%B0%E5%9B%BE%E7%93%A6%E7%89%87%E5%9D%90%E6%A0%87%E7%B3%BB%E5%AE%9A%E4%B9%89%E5%8F%8A%E8%AE%A1%E7%AE%97%E5%8E%9F%E7%90%86/)
196194
197-
[test-result]:https://github.com/CntChen/tile-lnglat-transform/tree/master/test/test_result
195+
> [Slippy](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames)
198196
199-
[slient-links]:slient-links
200-
[Slippy]:http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
197+
## 💖 致谢
201198
202-
## log
203-
* 修复瓦片上像素坐标计算的 bug 2017.08.12
204-
* 添加 OSM 转换对象 2016.05.10
205-
* 添加 TMS 转换对象,适用于腾讯地图 2017.03.07
206-
* 添加 Bing quadkey 转换 2017.03.14
199+
> [tile-lnglat-transform](https://github.com/CntChen/tile-lnglat-transform)
207200
208-
## 完

build/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,5 @@ const r = {
621621
TileLnglatTransformBing: A
622622
};
623623
export {
624-
F as TileLnglatTransformBaidu,
625-
A as TileLnglatTransformBing,
626-
N as TileLnglatTransformGaode,
627-
B as TileLnglatTransformGoogle,
628-
R as TileLnglatTransformOSM,
629-
v as TileLnglatTransformTencent,
630624
D as default
631625
};

build/index.umd.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "tile-lnglat-transfrom-es6",
3-
"version": "1.0.6",
2+
"name": "tile-lnglat-transform-es6",
3+
"version": "1.0.0",
44
"description": "提供了高德、百度、谷歌、腾讯和必应地图的经纬度坐标与瓦片坐标的相互转换",
55
"type": "module",
66
"main": "build/index.js",
@@ -19,22 +19,20 @@
1919
},
2020
"repository": {
2121
"type": "git",
22-
"url": "https://github.com/pluto369/tile-lnglat-transfrom-es6.git"
22+
"url": "https://github.com/pluto369/tile-lnglat-transform-es6.git"
2323
},
2424
"publishConfig": {
2525
"registry": "https://registry.npmjs.org/"
2626
},
2727
"keywords": [
2828
"tile",
2929
"coords",
30-
"transfrom"
30+
"transform"
3131
],
32-
"author": "pluto957",
32+
"author": "aliothor",
3333
"license": "MIT",
3434
"devDependencies": {
35-
"@rollup/plugin-swc": "^0.2.1",
3635
"@types/node": "^20.8.6",
37-
"rollup": "^4.1.3",
3836
"typescript": "^5.2.2",
3937
"vite": "^4.4.11"
4038
}

0 commit comments

Comments
 (0)