npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

transformlnglat

v1.0.4

Published

- [gcj02towgs84 国测局转 wgs84] - [gcj02tobd09 国测局转百度] - [bd09togcj02 百度转国测局] - [bd09towgs84 百度转 wgs84] - [wgs84togcj02 wgs84 转国测局] - [wgs84tobd09 wgs84 转国百度]

Readme

以下转换说明

  • [gcj02towgs84 国测局转 wgs84]
  • [gcj02tobd09 国测局转百度]
  • [bd09togcj02 百度转国测局]
  • [bd09towgs84 百度转 wgs84]
  • [wgs84togcj02 wgs84 转国测局]
  • [wgs84tobd09 wgs84 转国百度]

import 引入方式

import { bd09togcj02, bd09towgs84 } from "transformlnglat";
bd09togcj02(118, 32)

js 引入方式

<script type="text/javascript" src="transformlnglat.js"></script>
<script type="text/javascript">
	transformlnglat.bd09togcj02(118, 32)Ï
</script>

支持的传入方式

以bd09togcj02为例:

  1. 传入经纬度 返回 Array 格式
bd09togcj02(113.3123,46.324)
返回[113.30583224697789, 46.31792664036065]
  1. 传入对象数组
bd09togcj02([{lng:113.3123,lng:46.324}])
返回[{lng:113.30583224697789,lat:46.31792664036065}]

2.1 支持第二项参数传入要转换的键(key)

bd09togcj02([{x:113.3123,y:46.324},...],['x','y']) 
返回[{x:113.30583224697789,y:46.31792664036065},...] 

2.2 第二项参数 支持多组合 key 进行转换

bd09togcj02([{x:113.3123,y:46.324,lng:113.3123,lat:46.324},...],[['x','y'],['lng','lat']]) 
返回[{x:113.30583224697789,y:46.31792664036065,lng:113.30583224697789,lat:46.31792664036065},...]
  1. 支持对象传入
bd09togcj02({lng:113.3123,lng:46.324})
返回{lng:113.30583224697789,lat:46.31792664036065}

3.1 支持第二项参数传入要转换的键(key)

bd09togcj02({lng:113.3123,lng:46.324}) 
返回{lng:113.30583224697789,lat:46.31792664036065}

3.2 支持多组合 key 进行转换

bd09togcj02({x:113.3123,y:46.324,lng:113.3123,lat:46.324},[['x','y'],['lng','lat']]) 
返回{x:113.30583224697789,y:46.31792664036065,lng:113.30583224697789,lat:46.31792664036065}
  1. 一维坐标数组
bd09togcj02([113.3123,46.324]) 
返回[113.30583224697789, 46.31792664036065]
  1. 二维坐标数组
bd09togcj02([[113.3123,46.324],[113.3123,46.324],...])
返回[[113.30583224697789, 46.31792664036065],[113.30583224697789, 46.31792664036065],...]
  1. 2和3的方式支持第三个参数传入,转换后的值是否替换原来的键值,默认为true替换,设置false则新生成转换后的键值
bd09togcj02([{x:113.3123,y:46.324},...],['x','y'],false) 
返回[{x:113.3123,y:46.324,newx:113.30583224697789,newy:46.31792664036065},...]
bd09togcj02({x:113.3123,y:46.324},['x','y'],false) 
返回{x:113.3123,y:46.324,newx:113.30583224697789,newy:46.31792664036065}

Ps: 2和3的方式默认会寻找键为lng、lat的值进行转换,一维二维坐标数组以及第二项参数必须按经度、纬度的顺序传入